Question: Create a class named Student. A Student has fields (instance variables) for an ID number, number of credit hours earned, quality points, and GPA. Write
Create a class named Student.
A Student has fields (instance variables) for an ID number, number of credit hours earned, quality points, and GPA. Write a constructor with no parameters that sets the ID number to 9999, the credit hours to 3 and quality points to 10, then calls a method (calculateGPA) to set the GPA to quality points divided by credit hours. Write "setter" methods (e.g., setIdNumber) to assign values to all fields except GPA and "getter" methods (e.g., getIdNumber) to retrieve the value in each field. Write a (void) method to display the values of all fields of Student. Save this class as Student.java.
Write a class named ShowStudent that instantiates two Student objects from the class you created, then uses data input by the user (via a Scanner) and setter methods to change the values for one of the Students. Note that you'll need to call caculateGPA to recalculate GPA after changing other data. Call the getter methods to display the info for each student. Save the application as ShowStudent.java.
Sample output should look like:
Student ID: 18429
Credit Hours: 12.0
Quality Points: 38
GPA: 3.16666667
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
