Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C# Create an Employee class with five fields: first name, last name, workID, yearStartedWked, and initSalary. It includes constructor ( s ) and properties to
C# Create an Employee class with five fields: first name, last name, workID, yearStartedWked, and initSalary. It includes constructors 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 constructors It definesthe CalcYearWorked function using current year yearStartedWked and saveit in the nYearWked variable. It also defines the CalcCurSalary function thatcalculates the current year salary by using initial salary with yearlyincrement.
Create a Manager class that is derived from Worker class.
In Manager class,it includes one field: yearPromo and constructors Itincludes a CalcCurSalaryfunction that calculate the current year salary by overriding the base classfunction using initial salary with yearly increment plus bonus. Themanagers salary calculates in two parts. It calculates as a worker before theyear promoted and as a manager after the promotion.
Write an application that reads the workers and managers information from files workertxt and managertxt 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 heshe has been working, and current salary.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored 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