Question: Write a C# program which creates a class Employee with the following attribute. 1. name The class should have a parameterized constructor and destructor, the
Write a C# program which creates a class Employee with the following attribute. 1. name The class should have a parameterized constructor and destructor, the getter/setter functions and a a virtual member function called pay () that returns the salary of the Employee. a. Create a class named as Salaried that inherits from class Employee. A Salaried object has the following attributes 1. salary This class should also have parameterized constructor and default destructor, setter/getter functions and a pay () member function. b. Similarly, develop a class named as Hourly that inherits from class Employee. An Hourly object is anguished by the following attributes 1. hours 2. rate This class should also have a parameterized constructor, default destructor, setter/getter functions and a pay () member function. Your program should create objects of Salaried and Hourly classes and then invoke the pay () function of these classes polymorphically (through Employee Object).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
