Question: Create a superclass, Student, and two subclasses, Undergrad and Graduate. The superclass student should have the following data members: Name, ID, Grade, Age and Address.

Create a superclass, Student, and two subclasses, Undergrad and Graduate. The superclass student should have the following data members: Name, ID, Grade, Age and Address. The superclass student should have at least one method: Boolean is passed (double grade); The purpose of the is passed method is to take one parameter, grade (value between 0 and 100) and check whether the grade has passed the requirement for passing a course. In the student class this method should be empty. The two subclasses, Graduate and Undergrad, will inherit all data members of the student class and override the method is passed. For the Undergrad class, if the grade is above 60.0 then is passed returns true, otherwise it returns false. For the Graduate class, if the grade is above 70.0 then is passed returns true, otherwise returns false. In main function create one Graduate object and one Undergraduate object. For each object, provide a grade and display the result of the is passed method

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!