Question: In C# please, Create an Employee class with five fields: first name, last name, workID, yearStartedWked, and initSalary. It includes constructor(s) and properties to initialize
In C# please,
Create an Employee class with five fields: first name, last name, workID, yearStartedWked, and initSalary. It includes constructor(s) and properties to initialize values for all fields.
Create an interface, SalaryCalculate, class that includes two functions: first,CalcYearWorked() function, it takes one parameter (currentyear) and calculates the number of year the worker has been working. The second function, CalcCurSalary() function that calculates the current year salary.
Create a Worker classes that is derived from Employee and SalaryCalculate class.
- In Worker class, it includes two field, nYearWked and curSalary, and constructor(s). It defines the CalcYearWorked() function using (current year yearStartedWked) and save it in the nYearWked variable. It also defines the CalcCurSalary() function that calculates the current year salary by using initial salary with 3% yearly increment.
Create a Manager class that is derived from Worker class.
- In Manager class, it includes one field: yearPromo and constructor(s). It includes a CalcCurSalary function that calculate the current year salary by overriding the base class function using initial salary with 5% yearly increment plus 10% bonus. The managers salary calculates in two parts. It calculates as a worker before the year promoted and as a manager after the promotion.
Write an application that reads the workers and managers information from files (worker.txt and manager.txt) and then creates the dynamic arrays of objects. Prompt the user for current year and display the workers and managers current information in separate groups: first and last name, ID, the year he/she has been working, and current salary.
In the text file, The first number is the number of workers/managers in the file.
Txt files are aligned as followed
worker.txt
5 Hector Alcoser A001231 1999 24000 Anna Alaniz A001232 2001 34000 Lydia Bean A001233 2002 30000 Jorge Botello A001234 2005 40000 Pablo Gonzalez A001235 2007 35000
manager.txt
3 Sam Reza M000411 1995 51000 2005 Jose Perez M000412 1998 55000 2002 Rachel Pena M000413 2000 48000 2010
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
