Question: Design a class Student that has private id, name, totalPoints (default = 0), gpa (default = 0), and array of grades (size = 3).

Design a class

Design a class "Student" that has private id, name, totalPoints (default = 0), gpa (default = 0), and array of grades (size = 3). The id should be generated automatically and incrementally for each new student and cannot be changed. The name should be initialized in the constructor and has a setter and getter. The class also has an addGrade that sets a grade for the student, a method calculatePoints that calculates the total points based on the student's grades, and a method calculateGPA that calculates the GPA of the student. Draw the UML diagram for the class. Write a test program that creates a student with the name "John Doe", set 3 grades for the student ('A','B', 'B'), calculate and print both the points and gpa. GPA is equal to (total points / 9). Points are calculated based on the following table: Grade A B C D F Point 12 11 10 9 0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The request is a multipart task involving objectoriented programming concepts Lets tackle each part ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!