Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // *****************************************************************************
- // * CS5-Payroll Calculator *
- // *****************************************************************************
- // * *
- // * Programmer : Ziad Bogalia *
- // * Chapter : CS5 *
- // * Assignment : ASGN-6 *
- // * Class Name : CS5-Payroll Calculator *
- // * Date Created : 3/20/2019 *
- // * Description : This class determines an employee's gross pay. *
- // * *
- // *****************************************************************************
- // Use System Namespace
- // Begin CS5-Payroll Calculator Class
- // Set Class A Rate constant = $15.00
- // Set Class B Rate constant = $12.50
- // Set Class C Rate constant = $10.00
- // Set Minimum Hours constant = 1.0
- // Set Maximum Hours constant = 80.0
- // *************************************************************************
- // * Method : Main *
- // * Description : This method calls the Input Employee Data and Display *
- // * Information methods. The operator is prompted if they *
- // * wish to enter data. *
- // *************************************************************************
- // Begin Main ()
- // Define Variables: Hours, Hourly Rate Code, Answer
- // Do
- // Clear Screen
- // Display Three Title Lines
- // Display Blank Line
- // Call Input Employee Data (Out: Hours, Hourly Rate Code)
- // Display Blank Line
- // Display "Call Display Information"
- // Display Blank Line
- // Do
- // Display Calculate Another Payroll Prompt
- // Input Answer
- // While ( Answer Not = "Y" And Answer Not = "N" )
- // While ( Answer = "Y" )
- // Clear Screen
- // Display End of Program Message
- // Display Blank Line
- // Display Press any key Prompt
- // Input Press Any Key
- // End Main
- // *************************************************************************
- // * Method : Input Employee Data *
- // * Description : This method inputs the hours and rate code from the *
- // * keyboard *
- // *************************************************************************
- // Begin Input Employee Data ( Out: Hours, Hourly Rate Code )
- // Define Variables: None
- // Display Hours Prompt
- // Input Hours
- // Do While ( Hours < Minimum Hours constant Or Hours > Maximum Hours constant )
- // Display Hours Error Message
- // Input Another Hours
- // End Do
- // Display Blank Line
- // Display Hourly Rate Codes (4 lines)
- // Display Blank Line
- // Display Rate Code Prompt
- // Input Hourly Rate Code
- // Do While ( Hourly Rate Code Not = "A" And Hourly Rate Code Not = "B" And Hourly Rate Code Not = "C" )
- // Display Hourly Rate Code Error Message
- // Input Another Hourly Rate Code
- // End Do
- // End Input Employee Data
- // *************************************************************************
- // * Method : Display Information *
- // * Description : This mlodule calculates the gross pay and displays *
- // * the employee's hours, hourly rate and gross pay *
- // * amount. *
- // *************************************************************************
- // Begin Display Information ( In: Hours, Hourly Rate Code )
- // Define Variables: Gross Pay
- // Display Hours
- // Display Call Get Hourly Rate Code ( In: Hourly Rate Code )
- // Display Blank Line
- // Calculate Gross Pay = Hours * Call Get Hourly Rate ( In: Hourly Rate Code )
- // Display Gross Pay
- // End Display Information
- // *************************************************************************
- // * Method : Get Hourly Rate *
- // * Description : This value returning module determines an hourly rate *
- // * based upon the rate code. *
- // *************************************************************************
- // Begin Get Hourly Rate ( In: Rate Code ) As a Whole Number
- // Define Variables: Hourly Rate
- // IF Class A = "A"
- // Rate = Class A constant
- // Else IF Class B = "B"
- // Rate = Class B constant + Class A constant
- // Else
- // Rate = Class C constant + Class A constant
- // End IF
- // Return Hourly Rate
- // End Get Hourly Rate
- // End CS5-Payroll Calculator Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement