Language is C# (i've got some code but it seems to not run correctly, would love...

90.2K

Verified Solution

Question

Programming

Language is C# (i've got some code but it seems to not runcorrectly, would love a new take)

Create an Employee class with five fields: first name, lastname, workID, yearStartedWked, and initSalary. It includesconstructor(s) and properties to initialize values for all fields.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 isderived 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 alsodefines the CalcCurSalary() function that calculates the currentyear salary by using initial salary with 3% yearly increment.Create a Manager class that is derived from Worker class. InManager class, it includes one field: yearPromo and constructor(s).Itincludes a CalcCurSalary function that calculate the current yearsalary by overriding the base class function using initial salarywith 5% yearly increment plus 10% bonus. The manager’s salarycalculates in two parts. It calculates as a worker before the yearpromoted and as a manager after the promotion. Write an applicationthat reads the workers and managers information from files(“worker.txt” and “manager.txt”) and then creates the dynamicarrays of objects. Prompt the user for current year and display theworkers’ and managers’ current information in separate groups:first and last name, ID, the year he/she has been working, andcurrent salary.

Worker.txt

5HectorAlcoserA001231199924000AnnaAlanizA001232200134000LydiaBeanA001233200230000JorgeBotelloA001234200540000PabloGonzalezA001235200735000

Manager.txt

3SamRezaM0004111995510002005JosePerezM0004121998550002002RachelPenaM0004132000480002010

Answer & Explanation Solved by verified expert
4.0 Ratings (623 Votes)
SOLUTIONI have solve the problem in C code with screenshot for easyunderstanding CODE Employeecsusing Systemusing SystemCollectionsGenericusing SystemLinqusing SystemTextusing SystemThreadingTasksnamespace MyNamespacepublic class Employeeprivate string firstNamepublic string FirstNameget return firstName set firstName value private string    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