Question: Help with below console application task in C# language: An abstract class is not a complete class, it misses some parts, and you cannot create
Help with below console application task in C# language:
An abstract class is not a complete class, it misses some parts, and you cannot create objects from it. The programmer who writes the derived classes must fill in the missing parts. Consider an abstract class Employee. Derive two hierarchies from this class as it is shown below:

Task is:
Implement Employee: The class includes:
o 3 different attribute, firstName, lastName and ssn (Social Security Number). Implement three read-only properties for them.
o A constructor that takes three arguments to initialize the attributes. o A ToString method that uses properties to return a string which represents the employee (the method overrides ToString method from class Object)
o An abstract method called Earning which returns a decimal value.
-
Implement SalariedEmployee: o The class has one additional attribute called weeklySalary. o Also a constructor that initialize all the attributes (uses base class constructor)
-
o Override the methods ToString and Earning (Earnings shall return the weeklySalary)
-
Implement HourlyEmployee: o The class has two additional attributes. Hours that shows hours worked for a week, and wage that represents payment per hour. o A constructor that initialize all the attributes (uses base class constructor)
-
o Override the methods ToString and Earning (Earning can just return the weeklySalary)
-
Inside the Main method, create some objects of your classes and call their methods.
Employee SalariedEmployee HourlyEmployee
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
