Question: C sharp please 1. Create the abstract class Animal. This class has one field - name and two methods: getName() and makeNoise(). The makeNoise() method

C sharp please

1. Create the abstract class Animal. This class has one field - name and two methods: getName() and makeNoise(). The makeNoise() method should be abstract. Derive two classes from Animal - Dog and Cat and implement the getName() and the makeNoise() method for each class. Create a container to store animals and then demonstrate how the makeNoise() method works for each type of animal.

2. 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

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!