ACSL Time Sheets is a program designed to calculate the daily pay for each employee.
Most hourly paying jobs require someone to enter information on a time sheet. The ACSL Amusement Park is open from 9:00 a.m. to 5:00 p.m. The Business Office enters a code representing the location where an employee works and the starting time and ending time for each day. The codes entered are as follows:
Time | Value |
---|---|
9:00 AM | 1 |
9:30 AM | 2 |
10:00 AM | 3 |
10:30 AM | 4 |
11:00 AM | 5 |
11:30 AM | 6 |
12:00 PM | 7 |
1:00 PM | 8 |
1:30 PM | 9 |
2:00 PM | A |
2:30 PM | B |
3:00 PM | C |
3:30 PM | D |
4:00 PM | E |
4:30 PM | F |
5:00 PM | G |
5:30 PM | H |
- Locations 1-9 get paid $10.00 per hour with no overtime for extra hours.
- Locations 10-19 get paid $8.00 per hour for the first 4 hours and $12.00 for any hours over 4.
- Locations 20-29 get $12.00 per hour for the first 4 hours and double that for any hours over 4.
There will be 4 lines of input. Each line will contain 3 characters representing the location, start time and end time for an employee.
For each input line print the daily pay for the employee. The fifth output will be the sum of the four daily pay amounts. All pay amounts must be printed in dollar and cents format.
- 5, 9, H
- 11, 1, 7
- 19, 3, F
- 25, 2, B
- $40.00
- $24.00
- $56.00
- $60.00
- $180.00
- 3, 9, H
- 17, 1, E
- 20, 5, G
- 15, 2, 8
- $40.00
- $62.00
- $84.00
- $24.00
- $210.00
Visit the Replit link here: https://replit.com/@Squealingfur185/ACSL-Time-Sheets-with-Swift-1#main.swift