Design a payroll program that prompts the user to enter an e
Design a payroll program that prompts the user to enter an employee\'s hourly pay rate and the number of hours worked. Validate the user\'s input so that only the pay rates in the range of $7.50 through $18.25 and hours in the range of 0 through 40 are accepted. The program should display the employees gross pay.
For my assignment I need to write the pseudocode and then input into raptor. I just need help with the pseudocode and I can figure out the raptor.... hopefully.
Heres What I have So Far:
//Declare Variables for hourly pay rate, hours worked, and gross pay.
Declare Real grossPay, hoursWorked, payRate
//Find pay rate and validate
Display \"Enter Employees Hourly Pay Rate:\"
Input payRate
While payRate <7.50 AND payRate >18.25
Display \"Error:Enter valid rate of pay between $7.50 and $18.25.\"
Input payRate
End While
// Find hours worked and validate
Display \"Enter # of Hours Worked\"
Input hoursWorked
While hoursWorked <0 AND hoursWorked >40
Display \"Error: Enter valid # between 0 and 40.\"
Input hoursWorked
End While
//Calculate gross of employee
Set grossPay= payRate * hoursWorked
Display \"Your gross pay is : $\"
Input grossPay
<-- I dont know where else to go from here or if I am correct so far; some guidance would be much appreciated. -->
Solution
Writing complete psuedocode for the given program:
DECLARE Real grossPay, hoursWorked, payRate
DISPLAY \"Enter Employees Hourly pay rate and number of hours worked\"
READ payRate and hoursWorked
IF payRate >=7.5 AND payRate<=18.5 THEN
IF hoursWorked >=0 AND hoursWorked<=40 THEN
SET grossPay=payRate* hoursWorked
WRITE \"Your Gross Pay is : grossPay\"
END INNER IF
ELSE
WRITE \"Error:Hours worked must be between 0 and 40 only\"
END OUTER IF
ELSE
WRITE \"Error:PayRate must be between 7.5$ and 18.5$ only
END OF PROGRAM
I have also converted above psuedocode into program and checked.It worked fine after execution too.

