Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please all i need is the class diagram and the extra credit part i can do the rest please . Draw a class diagram by

please all i need is the class diagram and the extra credit part i can do the rest please .

Draw a class diagram by hand for the following program on the scratch paper provided by the test administrator. Be sure to clearly write CLASS DIAGRAM at the top of the page of scratch paper. Remember to include the relationship between the components and multiplicity values in the diagram. (15 points) Type the code for the Student class (26 points) and the application (19 points) in the space provided below. Be very careful about spelling, spacing, indentation, keywords, operators, uppercase letters, and lowercase letters, since these are all very important in programming. Be sure to press the Enter key at the end of each line. If you have Word or Notepad available on your computer, you may use these tools to create your class diagram and write your code. Attach any additional files to later questions. Develop a program that calculates a students grade point average (gpa) using the class and application described below. A Student class that stores the following: the student's id number the student's age, and the students gpa. Include the following methods. Be sure to incorporate error checking, when appropriate. a default constructor, a second constructor that receives two parametersthe first should be the student id number and the second should be the age, accessor and mutator methods for the student id number and the student's age, an accessor for the gpa, but no setter for the gpa, and a method named calculateGpa() that calculates and displays the gpa. The calculateGpa() method inputs the five (5) grades the student has earned this semester, which the user will enter on the keyboard as a numeric value (4 for an A, 3 for a B, 2 for a C, 1 for a D, and 0 for an F). The gpa is calculated by adding up all the grades and dividing the total by five (5). You MUST use a loop to input the grades and calculate the gpa. Be sure to use constants when appropriate. An application program that contains the main method. The main method must do the following, in the order shown below: create a Student object named john and initialize this object using the default constructor, create another Student object named maria using the second constructor to initialize her student id number to SR1234 and her age to 18, set the student id number for john to FR9876, print the student id number for john, and then calculate and print johns gpa, and print the age for maria, and then calculate and print marias gpa. EXTRA CREDIT. This part of the problem is not required. However, any points earned on this part of the problem will be added to your score, improving your score. Each item in this part of the problem is worth the number of points indicated below. Write the code for an additional method in the application named printStudentInfo(), which receives a Student object as a parameter. The printStudentInfo() method should display the student id number, age, and the gpa. (6 points) Add code statements to the main() method to call the printStudentInfo() method twice, once for each of the objects created in the main() method. (4 points)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Intelligent Databases Technologies And Applications

Authors: Zongmin Ma

1st Edition

1599041219, 978-1599041216

More Books

Students also viewed these Databases questions