Question
Create a C# Program Similar to Program 4 that illustrate the polymorphism concept. Create a base class and name this class as Employee. It should
Create a C# Program Similar to Program 4 that illustrate the polymorphism concept.
Create a base class and name this class as Employee.
It should have 1 member variable: empName.
1 constructor so that the employee name can be saved for each object.
A method called calcPaidCheck. And it is a virtual method
Create a derived class named HourlyWorker
Create an override method calcPaidCheck. Paid amount = hourly rate x hours worked
Create a derived class name SalaryWorker
Create an override method CalcPaidCheck and the paid amount with be annual-salary/ 12
In the main method, create an array of Employee, and test with 2 worker employees and 2 salary employees
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started