Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in JAVA please. thank you! You are hired by a small company to design a payroll system to perform payroll calculations based on the type

in JAVA please. thank you! image text in transcribed
image text in transcribed
You are hired by a small company to design a payroll system to perform payroll calculations based on the type of employee (manager and hourly worker). Managers are paid a fixed weekly Salary regardless of the number of hours worked; hourly workers are paid by the the hours and receives overtime pay (50% more overtime pay, but overtime cannot exceed 20 hours per week). Both managers and hourly workers have something in common. For example, their names. However, the way each person's earnings are calculated depends on the type of employee, so you decided to define the common features in a more generic dass named Employee, then create two subclasses, Manager and Hourly Worker for manager and hourly worker, respectively. Design an abstract class named Employee Java with the following data members and methods: Data members: Art.Name, Last Name All getter and setter methods Constructor takes first name and last name as parameters. toString methods to return name (Steve Davis, for example) BARings to return earnings (double think about if it is appropriate to be defined as abstract) Create Manager.java and make it a subclass of Employee. This class should have 11s own data member: weeklySalas (double): Getter and setter method for the new data member Implement earnings() method to return weekly salary be sure to validate weekly salary, the salary range is between 4800 and 42000, for any other numbers, sign O) Override sosting method to type of employee followed by manage name. For example, Manage: Steve Davis Create HourlyWorker.java and make it & subclass of Employee: Data members: wage (per hours), hours (hours worked for a week) Getter and setter methods remember, number of hours worked per week cannot exceed 60 hours. If a number over 60 13 entered, 15 Will be reduced to 60 hours: wage range: 25 - 450, all other numbers are considered as invalid and assign default vage, which is $35 per hour) Implements earning method Overtide 50 0 to return employee type and time for example, Hourly Workert John Wesen Write a tester class named Tester. Java to test your payroll system. Your tester class will read daca le employee.txt) and create employee obtects then Print payment for each employee. The sample input file Layout Reference: Mailings Review View Help Tell me what you want to do Panen class will read data file (employee.txt) and create employee objects, then print payent for each employee. The sample input file: Steve Davis 1200 35.5 50 atthew 25 Alex Bower 5000 Atanas Asanas Radenska aline Marting with is a manager, followed by weekly salary, a line starting with is a hourly worker, followed by wape and hours. Sample output: Manager: Steve Davis Earned: 1200.0 Hourly Worker: John Kanet Earned: 1952.5 Hourly Worker: Matthew Williams Earnedi 1000.0 Manager Alex Bowers Earnedt 0.0 Hourly Worker: Atan Earned: 2450.0

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

e. What are notable achievements of the group?

Answered: 1 week ago