Partial preview of the text
Download Object Oriented Programming/CSE213/Final Examination/code and more Summaries Computer Science in PDF only on Docsity!
Section 1 CSE213 - Object Oriented Programming Autumn 2024 Time: 1 hour Final Examination Full marks: 100 Part 2: Coding Download and extract the ZIP file from the given link. Rename the extracted folder and replace “1234567” with your ID. Now open the project in IntelliJ IDEA. Disconnect the internet NOW if you haven’t already! Scene 1 (scene1-data-generation. fxml): 1. Add necessary fx :id and onAction event handlers in SceneBuilder. Also fix generic types of corresponding controller class fields as appropriate 5 2. Add an initialize method in the controller class 8 a. Resolution ComboBox options should be HD, HD+, Full-HD, QHD b. Diagonal ComboBox options should be 17 inches, 19 inches, 22 inches, and 24 inches c. Connect TableColumns with appropriate fields of the model class 3. In the onAction event handler of the “Add Monitor” Button, write codes to add a new monitor object to the TableView. You should also add simple validation so that blank input is rejected. 6 4. Inthe onAction event handler of the “Save to BIN file” Button, write codes to save the Monitor objects from the TableView in monitors. bin file. You MUST use ObjectOutputStream or its subclass for this task. 10 5. Inthe onAction event handler of the “Go to Scene2” Button, write codes to switch to Scene 2 3 Scene 2 (scene2-data-processing. fxml): 6. Add necessary fx :id and onAction event handlers in SceneBuilder. Also fix generic types of corresponding controller class fields as appropriate 5 7. Add an initialize method in the controller class 5 a. Connect TableColumns with appropriate fields of the model class 8. Inthe onAction event handler of the “Load data from BIN file” Button, write codes to load data from monitors .bin file and show loaded objects in the TableView. You MUST use bjectInputStream or i lass for this task. 10 9. Inthe onAction event handler of the “Back to Scene1” Button, write codes to switch to Scene1 3 Model class: 10. Write a model class named Monitor_ . The model class must have: a. appropriate fields to capture inputs from Scene 1. 5 b. Generated methods (Constructors, Getters, Setters, and toString) 5 c. AgetPPI method that calculates the pixels-per-inch (PPI) of the monitor according to the following table: 5 Diagonal 47” 19” 22” 24” Resolution HD 86 77 67 61 HD+ 108 97 83 76 Full-HD 130 116 100 92 QHD 173 155 134 122