General Knowledge Basic General Knowledge Subjective
Mar 19, 2013

Write a program which inputs the ordinary time and overtime worked, calculating the gross pay.

The rate is 4.20 per hour, and overtime is time and a half.

Detailed Explanation

program PROG8 ( input, output );
var grosspay, ordinary_time, hourlyrate, overtime, ot_rate: real;
begin
hourlyrate := 4.20;
ot_rate := hourlyrate * 1.5;
writeln('Please enter the number of hours worked');
readln( ordinary_time );
writeln('Please enter the number of overtime hours');
readln( overtime );
grosspay := (ordinary_time * hourlyrate) + (overtime * ot_rate);
writeln('The gross pay is $', grosspay:5:2 )
end.

Discussion (0)

No comments yet. Be the first to share your thoughts!

Share Your Thoughts
Feedback