Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C sharp please Declare the abstract Person class that describes a human and the Student class that derives from Person. The attributes in each instance

C sharp please
Declare the abstract Person class that describes a human and the Student class that derives from Person. The attributes in each instance of type Person should include: name, age and id. The attributes in each instance of type Student should include, in addition to those that inherited from class Person, the attribute average. Create a third class Employee that inherits from Person but includes a field for department and company name. In the Person class, write an abstract method, ToString(), that returns the fields of an object. Write getters and setters for the attributes of all three classes. Then create a container to store Person objects and use the ToString() method to demonstrate how polymorphism works

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

Database Principles Programming And Performance

Authors: Patrick O'Neil

1st Edition

1558603921, 978-1558603929

More Books

Students also viewed these Databases questions

Question

Identify five strategies to prevent workplace bullying.

Answered: 1 week ago