[Model Paper] MIT 512-2 Object Oriented Programming
[Model Paper] MIT 512-2 Object Oriented Programming
Instructions to candidates
Number of Pages: 02
Total time allocation: Two (02) hours
Total mark allocation: 100 marks
Number of questions: 02
Answer All Questions.
Save your answers in a MS Word file including the screen-shots of the output(s) of your programs.
Finally, convert it to a PDF file and rename with your Registration Number. (Ex. “MIT_23_152.pdf”)
Also, include all your .Java files and NetBeans Project Folder(s) in to a single folder, rename with
your Registration Number then compress (.zip) it. (Ex. “MIT_23_152.zip”)
Upload:
1. PDF file which consists of the Answer Script
2. Compressed (.zip) folder which consist of the .Java files and NetBeans Project files
To the VLE.
1.
a.
i. Find all possible values for y having 0.1 intervals:
y = -3x3 + 5 where -1 < x < 1
(5 marks)
ii. Write a Java program to store the above part (i) computed x and y combinations in a
two-dimensional (2D) array. Use a for loop to print the array elements.
(10 marks)
b. Solve the following simultaneous equations to find x and y:
3x -y = 10
x2 + y2 = 100
(10 marks)
2.
a. Download the “Sample_Data.xlsx.” from VLE. Open the corresponding tab of the MS
Excel sheet according to the last digit of your Registration Number. Ex. If your Registration
Number is: UWU/MIT/23/152, go to the second tab. (if the last digit of your Registration
Number is ‘0’, then open the last tab.)
i. Create a Database in MySQL Workbench.
(5 marks)
ii. Create a Table in the Database you created in part (i). Then insert the sample data
available in the MS Excel sheet (in the relevant tab). (Please attach screen-shots
illustrating the Table structure and data in the Answer Script.)
(10 marks)
b.
i. Create a new Java Project using Apache NetBeans IDE. Add “mysql-connector-j-
9.0.0.jar” to the Project’s Libraries. (Please attach screen-shots in the Answer Script.
Intermediate steps are not necessary.)
Page 1 of 3
(10 marks)
ii. Perform other necessary configurations to connect the SQL database to the Java
application. (Please attach screen-shots in the Answer Script. Intermediate steps are
not necessary.)
(10 marks)
c.
i. Design the following (Fig. 01) Graphical User Interface (GUI). The default values of
the controls (i.e., Text appearing on the combo-boxes) may be different since your
application domain (and related data) might not be the same.
Find the control type in the Table 1.
Page 2 of 3
• Control Labeled as 9 is a non-editable Table, you may pre-define the model
matching to the columns of the database Table.
• Control Labeled as 10 is a editable Table, allow the users to enter the
corresponding values (a single row) to the Table.
• Accordingly, when the Button (Labeled as 11) is clicked, the generated SQL
statement (INSERT INTO) should be displayed in the Text Area (Labeled as 12).
(25 marks)
[End of Paper]
Page 3 of 3