75.8k views
4 votes
in java Write two classes one student class and one driver class. the driver class needs to instantiate three student objects(student name, student ID, student gpa out of 4). Then print student info include gpa. Then add 0.20 to gpa if gpa above or equal to 80 and add 0.10 if gpa is < 3.00

User Bjornicus
by
7.1k points

1 Answer

3 votes

Final answer:

To solve the problem, create a Student class with student name, ID, and GPA properties, and methods to update the GPA. In the Driver class, instantiate three Student objects, set the properties, and update the GPA. Print the student information with the updated GPA.

Step-by-step explanation:

To solve the problem, we need to create two classes: Student and Driver. In the Student class, we need to define the properties: student name, student ID, and student GPA. We also need to create a method to add 0.20 to the GPA if it is greater than or equal to 80 and add 0.10 if it is less than 3.00. In the Driver class, we can instantiate three Student objects, set their properties, and use the methods to update the GPA. Finally, we can print the student information, including the updated GPA.

User Kilian Foth
by
8.7k points