Question
1. Create a class Student that has three private data members: name, id, and gpa, of type String, int, and double respectively. The class should
1. Create a class Student that has three private data members: name, id, and gpa, of type String, int, and double respectively. The class should have the following public member methods: a. Two constructors, one with no parameters and one with three parameters. The constructor with no parameters should assign an empty string to name and 0 to id and gpa. The constructor with three parameters assigns its three arguments to the data members name, id, and gpa respectively. b. Accessor and mutator methods for each data member. c. Method toString() that returns the student information as a string in the format: name, id , gpa
2. Create a class GradeBook that has one private data member roster which is an array of objects of type Student and that can hold up to 50 Student objects. The class should have the following public member methods: a. A default constructor that creates an array of 50 elements and assigns it to roster. b. A constructor with one parameter list that is an array of type Student. The constructor creates the array roster with the same size as list and makes a deep copy of list into the array roster. (use the statement below to make a deep copy of each element from list to the corresponding element in roster) roster[i] = new Student(list[i].getName(), list[i].getID(), list[i].getGPA()); c. A method findStudentID that takes one parameter, the id of a student, and returns a string with the information of the student if the ID is found or an empty string otherwise. d. A method getAverageGPA that returns the average GPA of all the students. e. A method display that prints the information of all the students. f. A method sortIDs that sorts the list of student objects based on the IDs (ascending order) g. A method lowestGPA that returns the information of the student with the lowest GPA as a string h. A method highestGPA that returns the information of the student with the highest GPA as a string For methods c, d, f, g, h, you may re-use the methods from ALA1 and modify them accordingly.
3. Create a class TestGradeBook to use and test classes Student and GradeBook. In the main function, do the following: a. Create an array named studentList to hold five Student objects. b. Initialize the array with the information of five students as listed below. Jerry Marcy 1234 3.25 Lily Merchant 1342 3.75 Eleanor Maxwell 4213 3.90 Fred Karl 2134 2.00 Anatoly Marsh 3421 3.25 c. Create an instance of the class GradeBook using the constructor with one parameter and pass the array studentList as an argument to the constructor. d. Display a menu for the user to select one of the following operations and write java code in the main method to implement each operation. 1: find student ID in the GradeBook object 2: display all student information stored in the grade book 3: find average GPA and display it 4: sort students by id and display the sorted list 5. find the student with the lowest GPA and display the student information 6. find the student with the highest GPA and display the student information 7. Quit program
4. Draw UML diagrams for the classes Student and GradeBook
5. Test your program for the required operations (1 to 7)
6. Document your code using Javadoc comments
******Can I ask what clarification is needed?****
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started