CITP 4350 Assignment 5
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 (cu
entyear) and calculates the number of year the worker has been working. The second function, CalcCurSalary() function that calculates the cu
ent 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 (cu
ent year – yearStartedWked) and save it in the nYearWked variable. It also defines the CalcCurSalary() function that calculates the cu
ent 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). Itincludes a CalcCurSalary function that calculate the cu
ent year salary by ove
iding the base class function using initial salary with 5% yearly increment plus 10% bonus. The manager’s 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 a
ays of objects. Prompt the user for cu
ent year and display the workers’ and managers’ cu
ent information in separate groups: first and last name, ID, the year he/she has been working, and cu
ent salary.
3
Sam
Reza
M000411
1995
51000
2005
Jose
Perez
M000412
1998
55000
2002
Rachel
Pena
M000413
2000
48000
2010
5
Hecto
Alcose
A001231
1999
24000
Anna
Alaniz
A001232
2001
34000
Lydia
Bean
A001233
2002
30000
Jorge
Botello
A001234
2005
40000
Pablo
Gonzalez
A001235
2007
35000