Start
//declare the variables
String employeeName
Real hoursWorked
Real hourlyPayRate
Real grossPay
Real netPay
Real taxRate
Integer const MAX_EMPLOYEES = 250
Integer employeeCount
Boolean continue
Character inputChar
Call displayOpeningMessage
//initialize the loop control variables
employeeCount = 0
continue = true
//process employees until user wants to stop or maximum number
//of employees have been reached
while (continue = true AND employeeCount <= MAX_EMPLOYEES )
Display "Do you want to process employee's pay?
Display "Enter 'Y' to continue, 'N' to stop"
Get inputChar
If (inputChar = 'Y' OR inputChar = 'y')
employeeCount = employeeCount + 1
Call getInput
Call calculatePay
Call displayOutput
Else
Continue = false
End if
end while
Display employeeCount, " employees have been processed"
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 calculatePay
calculateGrossPay
calculateNetPay
end Module
Module calculateGrossPay
//calculate the gross Pay
Set grossPay = hourlyPayRate * hoursWorked
End Module
Module calculateNetPay
//find the tax rate, then calculate netPay
//note do not need to check for lower bound
//since lower bound is checked as the upper bound of the
//previous condition
If grossPay < 1500 then
taxRate = .15
else if grossPay < 3000 then
taxRate = .19
else if grossPay < 5000 then
taxRate = .21
else if grossPay < 6000 then
taxRate = .23
else
taxRate = .27
End if
netPay =grossPay * (1 - taxRate) //same as grossPay - grossPay*taxRate
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 Rate: ", taxRate
Display "Net Pay: ", netPay
End Module
Module displayTerminationMessage
//display termination message
Display "Thank you for using Pay Calculator"
Display "Enter any key to quit"
End Module
Chat with our AI personalities
one- input tables and three input tables
a formula
Total yield in a unit in a unit input. Graphically the production yield can be plotted against the unit input to determine the production yield at any point.
Domain
All i know it is about science. If anybody knows please reply :}