A program is required to calculate the weekly pay for an employee. The pay clerk inputs an

employee ID, hours worked and an hourly rate. The program will output the employee ID, and
Gross Pay. Gross Pay is the sum of regular pay plus any overtime pay earned. Overtime pay is
paid at 1.5 times the pay rate for any hours worked over 40

1 answer

I'm sure you can do the I/O. The calculation is

if hours <= 0
  print "error - no hours entered"
else if hours <= 40
   pay = rate * hours
else
  pay = rate*40 + rate*1.5*(hours-40)
endif