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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started