CSE205 Object Oriented Programming and Data Structures Programming Project 3 :: 25 Points 1 Project Instructions • Create a folder named p3. • Copy all your .java source code files to p3. Do not copy...

1 answer below »
Programming Project Instructions and Source Codes are attached for expert's solution guidelines; other/additional src is added thereto. Please adhere strictly and be attentive to the details.


CSE205 Object Oriented Programming and Data Structures Programming Project 3 :: 25 Points 1 Project Instructions • Create a folder named p3. • Copy all your .java source code files to p3. Do not copy the .class files or any testing files. • Compress the p3 folder creating a zip archive file named p3.zip. • Upload p3.zip to the Programming Project 3 (P3) submission page in Gradescope. • The project deadline may be found in the Course Schedule section of the Syllabus. • Consult the Syllabus for the late submission and academic integrity policies. 2 Learning Objectives 1. Complete all of the learning objects of the previous projects. 2. To implement a GUI interface and respond to action events. 3. To implement and use the binary search algorithm. 4. To implement and use the quick sort algorithm. 5. To implement the java.lang.Comparable interface. 3 Background This project shall implement a program which stores grade information for students in a class and allows that grade in - formation to be edited. The data shall be stored in a database file named gradebook.dat. There shall be one student record per line, where the format of a student record is: last-name first-name ex1 ex2 ex3 hw1 hw2 hw3 hw4 hw5 where: last-name The student's last name. A contiguous string of one or more characters, with no spaces. first-name The student's first name. A contiguous string of one or more characters, with no spaces. ex1, ex2, ex3 The student's scores on three exams, may be zeros. Each exam is worth 100 pts. hw1-hw5 The student's scores on five homework assignments, may be zeros. Each assignment is worth 25 pts. Here is an example gradebook.dat file which you may use for testing if you wish: Sample gradebook. dat Simpson Lisa 100 100 100 25 25 25 25 25 Flintstone Fred 80 60 40 15 17 22 18 23 Jetson George 70 83 81 20 21 22 23 25 Explosion Nathan 7 6 5 4 3 2 1 0 Muntz Nelson 60 70 50 20 15 10 5 8 Terwilliger Robert 80 90 95 23 21 19 17 23 Flanders Ned 85 95 75 12 14 17 23 16 Bouvier Selma 16 16 16 16 16 16 16 16 Spuckler Cletus 1 2 3 4 5 6 7 8 Wiggum Clancy 18 16 14 12 10 8 4 2 Skinner Seymour 78 83 99 19 23 21 24 18 3 Software Requirements 1. The GUI shall be implemented in a class named View. When the program starts the View frame shall appear as shown in Fig. 1. 2. The View frame shall be 525 pixels wide and 225 pixels high. 3. The program shall display the program name in the title bar. You may change the name of the program to anything you wish. 4. The X close button in the title bar shall be disabled, i.e., when it is clicked the program shall not exit and the View shall remain unchanged. © Kevin R. Burger :: Arizona State University :: Rev 033221 :: It is a copyright violation to publish this document w/o permission Page 1 CSE205 Object Oriented Programming and Data Structures Programming Project 3 :: 25 Points Figure 1: The View Frame 5. The student records shall be stored in a gradebook database in a file named gradebook.dat. 6. When the program starts, if the gradebook.dat file cannot be opened for reading, the program shall display an error message dialog (using the JOptionPane.showMessageDialog() method) informing the user that the gradebook database could not be opened for reading and that the program will terminate. When the user clicks the OK button the pro - gram shall terminate. See SR 27. 7. When the program exits, if the gradebook.dat file cannot be opened for writing, the program shall display an error message dialog (using the JOptionPane.showMessageDialog() method) informing the user that the gradebook database could not be opened for writing and that clicking the dialog's OK button will cause the program to terminate without updating the gradebook database. When the user clicks the OK button the program shall terminate. See SR 27. 8. When the program starts, no student record shall be displayed and the text fields shall be empty. See SR 1. 9. The last names of the students in the gradebook database shall be unique (because the last name is the key when searching the database). 10. When the program starts, it shall read the contents of the gradebook database from gradebook.dat and shall sort the list of students into ascending order by last name (per the Software Design requirements, it shall sort using the quick sort sorting algorithm). The sort is performed so that the program may search the database in memory for a specific student record using the binary search algorithm. 11. If the student record for a student who's last name is "Simpson" is being displayed, Fig. 2 shows how the View shall appear, displaying the student's full name, homework scores, and exam scores. See SR's 12–14. Figure 2: The View Displaying a Student's Grades 12. When a student record is being edited, the full name of the student shall be displayed in the Student Name text field. 13. When a student record is being edited, the student's homework 1–5 scores shall be displayed from left to right in the Homework text fields. 14. When a student record is being edited, the student's exam 1–3 scores shall be displayed from left to right in the Exam text fields. © Kevin R. Burger :: Arizona State University :: Rev 033221 :: It is a copyright violation to publish this document w/o permission Page 2 CSE205 Object Oriented Programming and Data Structures Programming Project 3 :: 25 Points 15. When the Search button is clicked, if there are values being displayed in the homework and exam fields, then those fields shall be cleared, i.e., set to empty, before the search begins. 16. When the user clicks the Search button and the Student Name text field is empty, an error message dialog shall be dis- played, requesting that the user enter a student's last name. The Student Name and numeric text fields shall all re- main empty. 17. When the user enters a name in the Student Name text field and then clicks the Search button, the gradebook data- base in memory shall be searched for a student who's last name matches the name in the text field. Per the Software Design requirements, the search function shall be implemented either using either iterative binary search or recursive binary search. 18. If the search discussed in SR 17 fails because there are no students whose last name matches the name in the Student Name text field, then an error message dialog shall be displayed informing the user that a student with that last name could not be found in the gradebook. After the user clicks OK to close the dialog, the Student Name text field shall be cleared and the numeric text fields shall remain empty. 19. If the search discussed in SR 17 succeeds, then the Homework and Exam text fields shall be updated with the stu- dent's homework and exam scores. The Student Name text field shall continue to display the student's full name per SR 12. 20. When the user is editing the homework and/or exam scores for a student and then clicks the Save button, the student record in memory shall be updated with the new scores. 21. See SR 20. These changes shall remain stored in memory and shall not be written to the gradebook database until the program exits. 22. When no student record is being edited (the homework and exam text fields are empty) and the user clicks the Save button, nothing shall happen. 23. When the user is editing the information for a student and clicks the Clear button, without first clicking the Save but- ton, then the student record in memory shall not be updated even if the homework and/or exam text fields had been modified. 24. When no student information is being displayed or edited, and the user clicks the Clear button, then nothing shall happen. 25. When the user is editing and has modified the information for a student and then clicks the Exit button, the student record (and all of the other student records) shall be written to the gradebook database before the program termi- nates. See SR 7 for how write failures are handled. 26. Whether the user is editing student information or not, when the Exit button is clicked, all of the student records shall be written to the gradebook database and then the program shall terminate. 27. Any error message dialogs shall be displayed centered within the View frame and display a message and one button la- beled OK. 4 Software Design Requirements 1. We recommend placing all the classes in a package named proj3 but this is not critical. 2. The UML class diagram in UMLet format can be found in the project archive's uml folder. The img folder contains the class diagram in PNG format. Your program shall implement all of the classes (including methods, declaring in- stance and class variables, and so on) of this design. 3. Class Main. A template source code file for Main is included in the project archive. The Main class shall contain the main() method which shall instantiate an object of the Main class and then call run() on that object. You shall com- plete the code by reading the comments and implementing the pseudocode, while using the UML class diagram for Main as a guide. © Kevin R. Burger :: Arizona State University :: Rev 033221 :: It is a copyright violation to publish this document w/o permission Page 3 CSE205 Object Oriented Programming and Data Structures Programming Project 3 :: 25 Points Main.run() shall catch the FileNotFoundException which may get thrown by GradebookReader.readGradebook() and shall terminate the program by displaying an error message diagram which informs the user that the gradebook data- base could not be opened for reading; it shall then terminate the program. See SR 6. Main.exit() shall catch the FileNotFoundException which may be thrown by GradebookWriter.writeGradebook() when the gradebook database cannot be opened for writing; the handler shall display an error message dialog informing the user that the gradebook database file could not be opened for writing and that the gradebook will not be updated; it shall then terminate the program. See SR 7. The parameter to Main.search() is the last name of a student and search() shall call Roster.getStudent() to search the Roster for a student with that last name. If the student is found, it will return a Student object which search()
Answered 2 days AfterFeb 10, 2022

Answer To: CSE205 Object Oriented Programming and Data Structures Programming Project 3 :: 25 Points 1 Project...

Tanisha answered on Feb 13 2022
102 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here