Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.51 KB | None | 0 0
  1. // *****************************************************************************
  2. // * CS5-Payroll Calculator *
  3. // *****************************************************************************
  4. // * *
  5. // * Programmer : Ziad Bogalia *
  6. // * Chapter : CS5 *
  7. // * Assignment : ASGN-6 *
  8. // * Class Name : CS5-Payroll Calculator *
  9. // * Date Created : 3/20/2019 *
  10. // * Description : This class determines an employee's gross pay. *
  11. // * *
  12. // *****************************************************************************
  13.  
  14. // Use System Namespace
  15.  
  16. // Begin CS5-Payroll Calculator Class
  17.  
  18. // Set Class A Rate constant = $15.00
  19. // Set Class B Rate constant = $12.50
  20. // Set Class C Rate constant = $10.00
  21. // Set Minimum Hours constant = 1.0
  22. // Set Maximum Hours constant = 80.0
  23.  
  24.  
  25. // *************************************************************************
  26. // * Method : Main *
  27. // * Description : This method calls the Input Employee Data and Display *
  28. // * Information methods. The operator is prompted if they *
  29. // * wish to enter data. *
  30. // *************************************************************************
  31.  
  32. // Begin Main ()
  33.  
  34. // Define Variables: Hours, Hourly Rate Code, Answer
  35.  
  36. // Do
  37. // Clear Screen
  38. // Display Three Title Lines
  39. // Display Blank Line
  40. // Call Input Employee Data (Out: Hours, Hourly Rate Code)
  41. // Display Blank Line
  42. // Display "Call Display Information"
  43. // Display Blank Line
  44.  
  45. // Do
  46. // Display Calculate Another Payroll Prompt
  47. // Input Answer
  48. // While ( Answer Not = "Y" And Answer Not = "N" )
  49.  
  50. // While ( Answer = "Y" )
  51.  
  52. // Clear Screen
  53. // Display End of Program Message
  54. // Display Blank Line
  55. // Display Press any key Prompt
  56. // Input Press Any Key
  57.  
  58. // End Main
  59.  
  60. // *************************************************************************
  61. // * Method : Input Employee Data *
  62. // * Description : This method inputs the hours and rate code from the *
  63. // * keyboard *
  64. // *************************************************************************
  65.  
  66. // Begin Input Employee Data ( Out: Hours, Hourly Rate Code )
  67.  
  68. // Define Variables: None
  69. // Display Hours Prompt
  70. // Input Hours
  71.  
  72. // Do While ( Hours < Minimum Hours constant Or Hours > Maximum Hours constant )
  73. // Display Hours Error Message
  74. // Input Another Hours
  75. // End Do
  76.  
  77. // Display Blank Line
  78. // Display Hourly Rate Codes (4 lines)
  79. // Display Blank Line
  80. // Display Rate Code Prompt
  81. // Input Hourly Rate Code
  82.  
  83. // Do While ( Hourly Rate Code Not = "A" And Hourly Rate Code Not = "B" And Hourly Rate Code Not = "C" )
  84. // Display Hourly Rate Code Error Message
  85. // Input Another Hourly Rate Code
  86. // End Do
  87.  
  88. // End Input Employee Data
  89.  
  90. // *************************************************************************
  91. // * Method : Display Information *
  92. // * Description : This mlodule calculates the gross pay and displays *
  93. // * the employee's hours, hourly rate and gross pay *
  94. // * amount. *
  95. // *************************************************************************
  96.  
  97. // Begin Display Information ( In: Hours, Hourly Rate Code )
  98.  
  99. // Define Variables: Gross Pay
  100. // Display Hours
  101. // Display Call Get Hourly Rate Code ( In: Hourly Rate Code )
  102. // Display Blank Line
  103. // Calculate Gross Pay = Hours * Call Get Hourly Rate ( In: Hourly Rate Code )
  104. // Display Gross Pay
  105.  
  106. // End Display Information
  107.  
  108. // *************************************************************************
  109. // * Method : Get Hourly Rate *
  110. // * Description : This value returning module determines an hourly rate *
  111. // * based upon the rate code. *
  112. // *************************************************************************
  113.  
  114. // Begin Get Hourly Rate ( In: Rate Code ) As a Whole Number
  115.  
  116. // Define Variables: Hourly Rate
  117.  
  118. // IF Class A = "A"
  119. // Rate = Class A constant
  120. // Else IF Class B = "B"
  121. // Rate = Class B constant + Class A constant
  122. // Else
  123. // Rate = Class C constant + Class A constant
  124. // End IF
  125.  
  126. // Return Hourly Rate
  127.  
  128. // End Get Hourly Rate
  129.  
  130.  
  131. // End CS5-Payroll Calculator Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement