Question: Using the principle of inheritance, write a program that creates classes as depicted on the figure; also you need to apply the following: For the

Using the principle of inheritance, write a program that creates classes as depicted on the figure; also you need to apply the following:

For the supper class Community Member create 3 variables (name, age, gender) and 3 methods( sayName( ), sayAge( ), say Gender ( ).

For Employee class; it is required to have a new variable and method such as Nationality and sayNathionality( ) .

For Student class; it is required to have a new variable and method such as Student ID and say Student_ID ( ).

Creating 3 objects for each class to display:

The name (for all classes)

The nationality (for Employee class)

The student ID (Student class)

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!