Advertisement
Guest User

Untitled

a guest
May 27th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Module main ()
  2. Declare String employeeName
  3. Declare Real hoursWorked
  4. Declare Real hourlyPayrate
  5. Declare Real grossPay
  6. Declare Real taxrate
  7. Declare Real netPay
  8. Declare Real taxDeduction
  9. Call getInput ()
  10. Call calculategrossPay ()
  11. Call output()
  12. Call calculateNetPay ()
  13.  
  14. employeeCount = 250
  15. continue = true
  16.  
  17. while (continue = true AND employeeCount <= MAX_EMPLOYEES)
  18.     output “Do you want to process another employee?
  19.     output “EnterYto continue, ‘Nto stop”
  20.  
  21. Get inputChar
  22. If (inputChar =YOR inputChar = ‘y’)
  23.     employeeCount = employeeCount + 1
  24.     Call getInput()
  25.     Call processing()
  26.     Call output()
  27.  
  28. Else
  29.     Continue = false
  30.  
  31. End If
  32.  
  33. End While
  34. Output employeeCount “Employees have been processed.”
  35. End Module
  36.  
  37. Module getInput ()
  38. OutputEnter Employee name, hours worked, hourly pay rate, grosspay”
  39. Input employeeName
  40. Input hoursWorked
  41. Input hourlyPayrate
  42. End Module
  43.  
  44. Module processing()
  45.     Call calculategrossPay()
  46.     Call calculateNetPay()
  47. End Module
  48.  
  49. Module calculategrossPay ()
  50. grossPay = hoursWorked * hourlyPayrate
  51. End Module
  52.  
  53. Module calculateNetPay
  54.     If grossPay < 1500 then
  55.         taxrate = .15
  56.     else if grossPay >= 1500 AND grossPay <= 2999 then
  57.         taxrate = .19
  58. else if grossPay >= 3000 AND grossPay <= 4499 then
  59.         taxrate = .21
  60. else if grossPay >= 4500 AND grossPay <= 5999 then
  61.         taxrate = .23
  62.     else if grossPay > 6000 then
  63.         taxrate = .27
  64.     End if
  65.         netPay = grossPay * (1 – taxRate)
  66.         taxDeduction = grosspay * taxrate
  67.  
  68. End Module     
  69.  
  70. Module output ()
  71. OutputThe gross pay for “,employeeName “is”,grossPay. “The amount of taxes deducted: “,taxDeduction “the Net Pay is: “,netPay.
  72. End Module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement