Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The owners of the Annan Supermarket would like to have a program that computes the monthly gross pay of their non - exempt hourly employees.

The owners of the Annan Supermarket would like to have a program that computes the
monthly gross pay of their non-exempt hourly employees. The user will enter an
employees first name, last name, the hourly rate of pay, and the number of hours worked
for the month, by the week. Assume there are 4 weeks in a month. In addition, Annan
Supermarkets would like the program to compute the employees net pay and overtime
pay. Overtime hours, any hours over 40, are paid at 1.5 the regular hourly rate. Net
pay is gross pay minus taxes (Refer to the tax table on the second page).
Define a class called Employee in a file named EmployeeClass.py. The class must have
private attributes to store the employee's name, hourly rate, the total hours worked, the
total regular hours worked (sum of hours <=40), and the total overtime hours worked (sum
of hours >40).
The class must also have methods to perform the following tasks:
A constructor (the initializer method) to initialize the hourly rate to the minimum
wage of $7.25 per hour and the hours worked (regular and overtime) to 0.0.
A method to get (a setter/mutator method)
the employee's name
the hourly rate
the hours work for the month (by the week assume 4 weeks in a month)
Do not write separate setters for regular and overtime hours. Use a while/for
loop that iterates four times to read the hours worked from the user and call the
setter method four times. Do not use a list to ead the hours worked. The
header of the method should look like this:
def setHoursWorked(self, hoursWorked):
A method to return (a getter/accessor method)
the employee's name
the hourly rate
the total regular hours work for the month
the total overtime hours for the month
A method to return (a getter/accessor method)
the monthly regular pay
A method to return (a getter/accessor method)
the monthly overtime pay.
A method to calculate the gross pay and the net pay.
An __str__ method to display the output which must include the following
information:
Employee's name
Total regular hours worked
Total overtime hours worked
Total hours worked
Pay rate
Monthly Regular Pay
Monthly overtime pay
Monthly gross pay
Monthly taxes
Monthly net pay
The __str__ method must not contain any print statements and must return a string.
Write a set of functions, including main, in a file named Program10.py that declares an
object of the class defined in the EmployeeClass.py file and test the methods written for
Tax Table
If the gross
Bracket pay is over But not over Tax
1 $0.00 $1,200.000%
2 $1,200.00 $2,500.0010%
3 $2,500.00 $4,500.0015%
4 $4,500.00 $8,000.0022%
5 $8,000.00 $10,000.0028%
6 $10,000.00 $15,000.0031%
7 $15,000.00 N/A 36%
Run 1 Run 2
Name: John Doe Name: Jane Doe
Hourly rate: $44.10 Hourly rate: $45.20
Hours worked: 40,30,40,35 Hours worked: 40,40,40,40
Run3 Run 4
Name: John King Name: kunle dood
Hourly rate: $15.50 Hourly rate: $55.50
Hours worked: 50,30,40,25 Hours worked: 50,40,35,55

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_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

The Temple Of Django Database Performance

Authors: Andrew Brookins

1st Edition

1734303700, 978-1734303704

More Books

Students also viewed these Databases questions