Can anyone explain these instructions to me.

English is not my first language and i have having hard time understanding what exactly the instructions are telling me to do.

Problem: Most hourly paying jobs require someone to enter information on a time sheet. The ACSL Amusement Park is open from 9:00a.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.

9:00AM=1 9:30=2 10:00=3 10:30=4 11:00=5 11:30=6
12:00 PM = 7 12:30=8 1:00=9 1:30=A 2:00=B 2:30=C
3:00=D 3:30=E

Location 1-9 get paid $10.00 per hour with no overtime for extra hours.
Location 10-19 get paid $8.00 per hour for the first 4 hours and $12.00 for any hours over 4.
Location 20-29 get $12.00 per hour for the first 4 hours and double that for any hours over 4.

INPUT: There will be 4 lines of input. Each line will contain 3 characters representing the location, start time and end time for an employee.

OUTPUT: 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.

1. 5, 9, H == 1. $40.00
2. 11, 1, 7 == 2. $24.00
3. 19, 3, F == 3. $56.00
4. 25, 2, B == 4. $60.00
5.?? == 5. $180.00
Last edited on
you are to write a payroll program.
Input will be

output will be
1. $
2. $
3. $
4. $
5. $Total

There will be 4 lines of input

Take the first line
5, 9, H
I would write my program to accept 5, 9, H or 5 9 H just to be safe.

line 1, worked at location 5, start time was 9 which = 1pm, end time was H which = 5pm for a total of 4 hours. 4 hours * pay for location 5 ($10) = $40.

Since the directions do not mention opening a file, it is assumed the input and output will be from command line.

It should be easy because the times are all based on 30 minutes.
The park is only open for 8 hours. I assume employees go home at that time.

You will have 3 functions 1. Determine Hours worked 2. determine location and pay rate 3. calculate pay for each line, and output for each line, and add to overall total.

Last edited on
Topic archived. No new replies allowed.