Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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

Start
//declare the variables
String employeeName
Real hoursWorked
Real hourlyPayRate
Real grossPay
Real netPay
Real taxRate
Integer const MAX_EMPLOYEES = 250
Integer employeeCount
Boolean continue
Character inputChar

Call displayOpeningMessage

//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â?

Get inputChar
If (inputChar = â??Yâ?? OR inputChar = â??yâ??)
employeeCount = employeeCount + 1
Call getInput
Call calculatePay
Call displayOutput
Else
Continue = false
End if
end while
Display employeeCount, â?? employees have been processedâ?

Call displayTerminationMessage
Stop

Module displayOpeningMessage
//provide a welcome statement and directions
Display â??Pay Calculatorâ?
Display â??Enter the requested values to calculate the gross pay for an employeeâ?
End Module

Module getInput
//get the input
Display â??Enter the Employeeâ??s nameâ?
Input employeeName

Display â??Enter the number of hours workedâ?
Input hoursWorked

Display â??Enter the hourly pay rateâ?
Input hourlyPayRate
End Module

Module calculatePay
calculateGrossPay
calculateNetPay
end Module

Module calculateGrossPay
//calculate the gross Pay
Set grossPay = hourlyPayRate * hoursWorked
End Module

Module calculateNetPay
//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
//previous condition
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
else
taxRate = .27
End if
netPay =grossPay * (1 - taxRate) //same as grossPay â?" grossPay*taxRate
End Module

Module displayOutput
//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
End Module

Module displayTerminationMessage
//display termination message
Display â??Thank you for using Pay Calculatorâ?
Display â??Enter any key to quitâ?
End Module

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91623479
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Rgb ledsthree light-emitting diodes leds one red one green

RGB LED's Three light-emitting diodes [LEDs] (one red, one green, one blue) turn on when a number 0-7 is passed through. Red turns on with even numbers, green turns on with odd numbers, blue turns on with multiples of 3. ...

Question suppose we perform n makeset operations followed

Question : Suppose we perform n MAKESET operations followed by m > n Find and/or Union operations? What is the worst case total amount of time spent using union by rank with path compression?

One-year treasury bills currently earn 225 percent you

One-year Treasury bills currently earn 2.25 percent. You expected that one year from now, 1-year Treasury bill rates will increase to 2.75 percent and that two years from now, 1-year Treasury bill rates will increase to ...

Recall that one of the ways to randomize an algorithm that

Recall that one of the ways to randomize an algorithm that operates on an array is to "shuffle" the array -- i.e., randomly permute it. Give an algorithm that randomly permutes an input array A. What is the run-time of y ...

Question after 1 year of launch ride sharing increased a

Question: After 1 year of launch, ride sharing increased a lot resulting in a lot of insertion requests to the database. Consider there is no room to further increase the size of server and changing database is not an op ...

My kids love playing uno and we just finished up an intense

My kids love playing UNO and we just finished up an intense round. Lets say that the deck has 80 cards. 20 red, 20 blue, 20 green and 20 yellow.  What is the probability of pulling 3 green cards if the first 2 are replac ...

How do you calculate the annual interest rate of 12

How do you calculate the annual interest rate of 12% compounded monthly. I know how to do for annually but not monthly. You are offered the opportunity to put some money away for retirement. You will receive 10 annual pa ...

In a particular two cities apartment prices are decreasing

In a particular two cities apartment prices are decreasing. One main factor driving apartment prices down in the cities is the supply in new apartments into the market is much greater than the increase in the demand for ...

Can someone please help in this question - if the the price

Can someone please help in this question - If the the price of a pack of 35-count Wipes box-pack increased by 12% while revenue from those wipes increased by 5%. Calculate the own-price elasticity of demand for Wipes box ...

Question summarize the process of how cameras and scanners

Question : Summarize the process of how cameras and scanners produce digital images. Compare differences between the production of images on film and digital images.

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As