A small startup software developer company needs to create a program that will calculate the pay of its employees. For the third version of the program, the company wants the program to accept an employeeâ??s name, the number of hours that the employee worked, and the hourly pay rate. The program will then calculate the gross pay, display the employeeâ??s name, number of hours worked, pay rate, and gross pay, but also calculate and display the net pay of the person after taxes have been calculated and deducted. The user will then be able to continue calculating the pay for additional employees until the user decides to stop. The user will then be able to continue calculating the pay for additional employees until the user decides to stop or until the maximum number of employees is reached. Create gross pay and net pay functions, and provide user input validation to check for a valid user name. Hours worked is between 0 and 80 hours, and the hourly wage is between $8.95 and $50.
Modify the Pseudocode below to Include the following:
Modify this Pay Calculator design to include a user-defined function to calculate the gross pay.
Modify this Pay Calculator design to include a user-defined function to calculate the net pay.
Modify this Pay Calculator design to include an input validation loop to ensure that the user provides a valid employee name (non empty); otherwise, the pay is not calculated. If the user decides not to provide an employee name, program will move to the next employee.
Modify this Pay Calculator design to ensure that the hours that an employee works is greater than 0 and less or equal to 80. If the hours worked are not valid, an error message shall be supplied to the user and the pay calculation will not be performed until the valid rate is provided. If the user decides not to provide a valid value, program will move to the next employee.
Modify this Pay Calculator design to ensure that the hourly pay rate is greater than or equal to $8.95 and less than $50. If the hourly rate is not valid, an error message shall be supplied to the user and the pay calculation will not be performed until the valid rate is provided. If the user decides not to provide a valid value, program will move to the next employee.
Complete a desk check of all algorithms, and modify the analysis and design to correct any errors.
The Current Psuedocode
//declare the variables
Integer const MAX_EMPLOYEES = 250
//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â?
If (inputChar = â??Yâ?? OR inputChar = â??yâ??)
employeeCount = employeeCount + 1
Continue = false
Display employeeCount, â?? employees have been processedâ?
//provide a welcome statement and directions
Display â??Pay Calculatorâ?
Display â??Enter the requested values to calculate the gross pay for an employeeâ?
//get the input
Display â??Enter the Employeeâ??s nameâ?
Display â??Enter the number of hours workedâ?
Display â??Enter the hourly pay rateâ?
//calculate the gross Pay
Set grossPay = hourlyPayRate * hoursWorked
//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
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
taxRate = .27
netPay =grossPay * (1 - taxRate) //same as grossPay â?" grossPay*taxRate
//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
//display termination message
Display â??Thank you for using Pay Calculatorâ?
Display â??Enter any key to quitâ?
Kindly see the attached document. For your convenience I have give different colors to ...
Pseudo code to calculate gross and net pay for employees