Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Illuminated

Authors: Catherine Ricardo

2nd Edition

1449606008, 978-1449606008

More Books

Students also viewed these Databases questions

Question

=+6. What need does it fulfill?

Answered: 1 week ago

Question

=+8. How can you differentiate your product in their eyes?

Answered: 1 week ago