Answered step by step
Verified Expert Solution
Link Copied!

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

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... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

More Books

Students also viewed these Programming questions

Question

=+a) Why is there no coefficient for Medium?

Answered: 1 week ago

Question

What is a Project life cycle and process group life cycle?

Answered: 1 week ago

Question

What does stickiest refer to in regard to social media

Answered: 1 week ago