Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Design a class Student that has private id, name, totalPoints (default = 0), gpa (default = 0), and array of grades (size = 3).
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
Step: 1
The request is a multipart task involving objectoriented programming concepts Lets tackle each part as described in the instructions 1 Design the clas...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