Question
This question is about completing a program that calculates monthly pay for a Waiter type of employee, and that displays the results. A Waiter is
This question is about completing a program that calculates monthly pay for a "Waiter" type of employee, and that displays the results.
A Waiter is an employee who does not earn a salary but receives a weekly wage based on the number of hours worked.
- The first 40 hours are paid at a pre-specified rate.
- Hours worked beyond 40 are paid at "time and a half" i.e. 1 times the pre-specified rate.
- A waiter may also earn tips, and these are added to the weekly wage.
- During the week running totals are kept for hours worked and for tips given.
- Once paid, running totals are reset to zero.
Download theTest.javaandEmployee.javasource files attached to this page.
To complete the program you need to implement the Waiter class that the Test class uses. The Waiter class should be a subclass of Employee.
You should not modifyTest.javaorEmployee.java.
Sample I/O:
**** Welcome to the CS Payroll System ****
Enter employee name:
Fred
Enter staff number:
055397
Enter hourly rate (Rand):
50
Enter choice:
(1) Record a shift. (3) Pay weekly wages.
(2) Record a tip. (4) View total pay to date.
(5) Quit.
1
Enter the hours worked:
8
Enter choice:
(1) Record a shift. (3) Pay weekly wages.
(2) Record a tip. (4) View total pay to date.
(5) Quit.
1
Enter the hours worked:
8
Enter choice:
(1) Record a shift. (3) Pay weekly wages.
(2) Record a tip. (4) View total pay to date.
(5) Quit.
2
Enter the amount tipped (Rand):
99
Enter choice:
(1) Record a shift. (3) Pay weekly wages.
(2) Record a tip. (4) View total pay to date.
(5) Quit.
3
Printing a cheque for R899.0 .......
Recording payment and resetting tips due and hours worked to zero.
Enter choice:
(1) Record a shift. (3) Pay weekly wages.
(2) Record a tip. (4) View total pay to date.
(5) Quit.
4
Total pay to date is R899.0
Enter choice:
(1) Record a shift. (3) Pay weekly wages.
(2) Record a tip. (4) View total pay to date.
(5) Quit.
5
(User input is shown in bold.)
In paper form: you may consult your notes and textbook. In digital form: you may consult the Javadocs, electronic textbook, your electronic notes or any resources uploaded by staff to Vula. These resources may be on Vula or on your storage device or PC/laptop/tablet.
Submit theWaiter.javasource file in a .ZIP file to the Automatic Marker.
Marks will be awarded for correctness only.
Attachments
Employee.java0 KBTest.java2 KB
Step by Step Solution
3.44 Rating (170 Votes )
There are 3 Steps involved in it
Step: 1
To complete the program you need to implement the Waiter class as a subclass of the Employee class H...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started