Answered step by step
Verified Expert Solution
Question
1 Approved Answer
b. #Define a base class Person, having attributes name, birthdate and city. Define the class Student that derives from Person class which ishaving attributes like
b. \#Define a base class Person, having attributes name, birthdate and city. Define the class Student that derives from Person class which ishaving attributes like rollno, branch, totalMarks and year as data member. The class should contain the instance method init and the abstract method percentage. Define two classes Grad and PostGrad which inherit from the base class Student. Both the classes should define their init method which asks user to enter totalMarks value and should override the abstract method percentage of the superclass. Note that totalMarks obtained are out of 600 and 400 for Grad andPostGrad classes respectively
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