In C# please and thanks so much, Create an Employee class with five fields: first name,...

50.1K

Verified Solution

Question

Programming

In C# please and thanks so much,

Create an Employee class with five fields: first name, lastname, workID, yearStartedWked, and initSalary. It includesconstructor(s) and properties to initialize values for allfields.

Create an interface, SalaryCalculate, class that includes twofunctions: first,CalcYearWorked() function, it takes one parameter(currentyear) and calculates the number of year the worker has beenworking. The second function, CalcCurSalary() function thatcalculates the current year salary.

Create a Worker classes that is derived from Employee andSalaryCalculate class.

  • In Worker class, it includes two field, nYearWked andcurSalary, and constructor(s). It defines the CalcYearWorked()function using (current year – yearStartedWked) and save it in thenYearWked variable. It also defines the CalcCurSalary() functionthat calculates the current year salary by using initial salarywith 3% yearly increment.

Create a Manager class that is derived from Worker class.

  • In Manager class, it includes one field: yearPromo andconstructor(s). Itincludes a CalcCurSalary function that calculatethe current year salary by overriding the base class function usinginitial salary with 5% yearly increment plus 10% bonus. Themanager’s salary calculates in two parts. It calculates as a workerbefore the year promoted and as a manager after the promotion.

Write an application that reads the workers and managersinformation from files (“worker.txt” and “manager.txt”) and thencreates the dynamic arrays of objects. Prompt the user for currentyear and display the workers’ and managers’ current information inseparate groups: first and last name, ID, the year he/she has beenworking, and current salary.

Please make streamreader read text from file and the new line sothat the text files stay original.

TEXT FILES:

worker.txt

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

Sam
Reza
M000411
1995
51000
2005
Jose
Perez
M000412
1998
55000
2002
Rachel
Pena
M000413
2000
48000
2010

Answer & Explanation Solved by verified expert
4.3 Ratings (553 Votes)
Employeecs using System using SystemCollectionsGeneric using SystemLinq using SystemText using SystemThreadingTasks namespace MyNamespace public class Employee private string firstName public string FirstName get return firstName set firstName value private string lastName public string LastName get return lastName set lastName value    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students