//declare the variables
String employeeName
Real hoursWorked
Real hourlyPayRate
Real grossPay
Real tax
Real netPay
Call displayOpeningMessage
Call getInput
Call calculateGrossPay
Call calculateTax
Call calculateNetPay
Call displayOutput
Call displayTerminationMessage
Stop
Module displayOpeningMessage
//provide a welcome statement and directions
Display "Pay Calculator"
Display "Enter the requested values to calculate the gross pay for an employee"
End Module
Module getInput
//get the input
Display "Enter the Employee's name"
Input employeeName
Display "Enter the number of hours worked"
Input hoursWorked
Display "Enter the hourly pay rate"
Input hourlyPayRate
End Module
Module calculateGrossPay
//calculate the gross Pay
Set grossPay = hourlyPayRate * hoursWorked
End Module
Module calculateTax
//calculate the tax depending on the gross pay and the chart mentioned
IF grossPay < 1500 Then
tax = .15 * grossPay
Else IF grossPay >= 1500 And IF grossPay <3000 Then
tax = .19* grossPay
Else IF grossPay >= 3000 And IF grossPay <4500 Then
tax = .21* grossPay
Else IF grossPay >= 4500 And IF grossPay <6000 Then
tax = .23* grossPay
Else
tax = .27* grossPay
EndIF
EndIF
EndIF
EndIF
End Module
Module calculateNetPay
//calculate the net pay by deducting the tax from gross pay.
netPay = grossPay -tax
End Module
Module displayOutput
//display the output
Display "The gross pay for ", employeeName, "is: "
Display "Hours worked: ", hoursWorked
Display "Hourly pay rate: ", hourlyPayRate
Display "Gross Pay: ", grossPay
Display "Tax: ",tax
Display "Net Pay: ",netPay
End Module
Module displayTerminationMessage
//display termination message
Display "Thank you XXX XXXXX Pay Calculator"
Display "Enter any key to quit"
End Module
A small startup software developer company needs to create a program that will calculate the pay of its employees. For the first version of the program, the company wants the program to accept an employee’s name, the number of hours the employee worked, and the hourly pay rate. The program will then calculate the gross pay, display the employee’s name, number of hours worked, pay rate, and gross pay.
3 answers
Write Pseudocode and explain the how do you do the program desk check?
A small startup software developer company needs to create a program that will calculate the pay of its employees. For the third version of the program, the company wants the program to accept an employee’s name, the number of hours the employee worked, and the hourly pay rate. The program will then calculate the gross pay, display the employee’s name, number of hours worked, pay rate, and gross pay, but also calculate and display the net pay of the person after taxes have been calculated and deducted. The user will then be able to continue calculating the pay for additional employees until the user decides to stop or until the maximum number of employees is reached.