Question: Q3: Create a class named Student. A student has fields for an ID number, number of credit hours earned, and number of points earned. (For
Q3: Create a class named Student. A student has fields for an ID number, number of credit hours earned, and number of points earned. (For example, many schools compute grade point averages based on a scale of 4, so a three- credit-hour class in which a student earns an A is worth 12 points. Also, create a class variable called lastStudentID which holds the last student ID number assigned to a student. Initialize it to 0. Each new student is assigned a student ID by adding one to this number. Update lastStudentID each time a student is created. Next, include methods to assign values to all fields separately. For example, one method should assign ID number, another should assign credit hours earned, etc. A Student also has a field for grade point average. Include a method to compute the grade point average field by divinding points by credit hours earned. Write methods to display the values in each Student field. Write a class named ShowStudent that instantiates a Student object from the class you created above. Set the necessary values and compute the Student grade point average, and then display all the values associated with the Student. Create three different students with different values
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
