0% found this document useful (0 votes)
2 views1 page

Payroll Calculation Program in Pascal

The document is a Pascal program that calculates payroll based on hours worked and hourly rate. It prompts the user for the number of hours and rate, checks for errors in input, and computes pay based on standard and overtime rules. The program continues to request input until a negative number of hours is entered.

Uploaded by

Yulef Dian
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Payroll Calculation Program in Pascal

The document is a Pascal program that calculates payroll based on hours worked and hourly rate. It prompts the user for the number of hours and rate, checks for errors in input, and computes pay based on standard and overtime rules. The program continues to request input until a negative number of hours is entered.

Uploaded by

Yulef Dian
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

PROGRAM Payroll;

CONST WeekHours = 7 * 24; (* Hours in a week *)


VAR Hours, Rate, Pay: INTEGER;

BEGIN
Write('Give number of hours and rate ');
Read(Hours, Rate);
WHILE Hours >= 0 DO BEGIN
IF (Hours < 0) OR (Hours > WeekHours) THEN
Writeln('Error in hours')
ELSE BEGIN
IF Hours <= 60 THEN
IF Hours <= 40 THEN
Pay := Hours * Rate
ELSE
Pay := ROUND(40*Rate + 1.5*Rate*(Hours-40))
ELSE
Pay : 70 * Rate + 2 * Rate * (Hours - 60);
Writeln('The pay is ', Pay);
END; {IF}
Write('Give number of hours and rate ');
Read(Hours, Rate);
END;{WHILE}
END.

You might also like