Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Module main ()
- Declare String employeeName
- Declare Real hoursWorked
- Declare Real hourlyPayrate
- Declare Real grossPay
- Declare Real taxrate
- Declare Real netPay
- Declare Real taxDeduction
- Call getInput ()
- Call calculategrossPay ()
- Call output()
- Call calculateNetPay ()
- employeeCount = 250
- continue = true
- while (continue = true AND employeeCount <= MAX_EMPLOYEES)
- output “Do you want to process another employee?”
- output “Enter ‘Y’ to continue, ‘N’ to stop”
- Get inputChar
- If (inputChar = ‘Y’ OR inputChar = ‘y’)
- employeeCount = employeeCount + 1
- Call getInput()
- Call processing()
- Call output()
- Else
- Continue = false
- End If
- End While
- Output employeeCount “Employees have been processed.”
- End Module
- Module getInput ()
- Output “Enter Employee name, hours worked, hourly pay rate, grosspay”
- Input employeeName
- Input hoursWorked
- Input hourlyPayrate
- End Module
- Module processing()
- Call calculategrossPay()
- Call calculateNetPay()
- End Module
- Module calculategrossPay ()
- grossPay = hoursWorked * hourlyPayrate
- End Module
- Module calculateNetPay
- If grossPay < 1500 then
- taxrate = .15
- else if grossPay >= 1500 AND grossPay <= 2999 then
- taxrate = .19
- else if grossPay >= 3000 AND grossPay <= 4499 then
- taxrate = .21
- else if grossPay >= 4500 AND grossPay <= 5999 then
- taxrate = .23
- else if grossPay > 6000 then
- taxrate = .27
- End if
- netPay = grossPay * (1 – taxRate)
- taxDeduction = grosspay * taxrate
- End Module
- Module output ()
- Output “The gross pay for “,employeeName “is”,grossPay. “The amount of taxes deducted: “,taxDeduction “the Net Pay is: “,netPay.
- End Module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement