Modify this pay calculator design

Assignment Help Basic Computer Science
Reference no: EM13952648

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

Reference no: EM13952648

Questions Cloud

Allocative efficiency in the production of cherries : "Allocative efficiency in the production of cherries means that consumers can eat all of the cherries they desire." Is this statement true or false?
Determine its molecular mass : The chlorophyll-a molecule, C55H72MgN4O5, is important in photosynthesis. Determine its molecular mass (in atomic mass units).
Risk of loss for the ski poles : DSEM argues that the ski poles belonged to Henry as soon as the truck left its distribution center, and therefore Henry had the risk of loss for the ski poles at the time of the accident. Circle the name of the party that had the risk of loss for ..
Why are development organizations less accountable : Why are development organizations less accountable to the people they serve than businesses or elected governments are?
Modify this pay calculator design : 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
Who supports bigger government : In 2012, researchers at the Edelman Public Relation firm asked a representative sample of 1,000 people in the United States this question: "Do you think your government regulates business too much, not enough, or the right amount?"
Difference between vertical and horizontal information : Describe the difference between "vertical" and "horizontal" information? How is each used by the police, fire or EMS personnel? Give a real-life example for each!
What is the mass of an aspartame molecule : The artificial sweetener NutraSweet is a chemical called aspartame (C14 H18 N2 O5). What is its molecular mass (in atomic units)? What is the mass (in kg) of an aspartame molecule?
Write a program that includes a function picnic() : This function will be called from the main program and when it returns to main, it will print out the values of HOTDOGS, HAMBURGERS,SALAD,PICKLES.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Creates a series of random 2d objects

Part 1: Create a program (OpenGL, or DirectX) that creates a series of random 2D objects, (or 3D objects that only move in 2D), about 25 is probably good but you may need more or less and has them move around on the screen, they should wrap around..

  Computer security week 4 discussions

Assume that you are part of a management team of a medium-size business that sells goods to consumers online. You know that your system was recently hacked, and that accounts and customer information may have been stolen. How do you respond to the..

  Enhanced home utility auditing program

The user should be able to do the following:Enter the cost per kilowatt-hour. Select from a list of home appliances which includes a > or >, among other appliances

  Encode audio data in two packets

How might you encode audio (or video) data in two packets so that if one packet is lost, then resolution is simply decreased to what would be expected with half bandwidth?

  Computing exact speed of a t1 line

Below what speed are there different leased line standards in different parts of the world? What is the exact speed of a T1 line?

  Function whose job is to input

Write a function whose job is to input #'s, non-# to quit, recover from the input failure by calling recover(), and tell main some statistics about the numbers read. A. unsigned readA();

  Transform the query into a query on fragments

Transform the query into a query on fragments.

  How long will it take to reach steady-state value

Investigate the effect of the parameter b on y(t). To do this, plot y versus t for several values of b on the same plot. How long will it take for y(t) to reach 98 percent of its steady-state value?

  Compute and list the horizontal derivative values

Compute and list the 15 horizontal derivative values that may be defined from the successive 3-point data sequences.

  Recommendations for the next steps the merged company

Create a minimum 12 PowerPoint slides to summarize the policy review conducted and your recommendations for the next steps the merged company should take to protect its data and information assets. The cover, summary/conclusion and reference slides a..

  Personal trainer

PERSONAL TRAINER, INC.

  Eliminate the transitive dependency in this relation

Vendor is functionally dependent on Compname and Compname is functionally dependent on Prodname. Eliminate the transitive dependency in this relation and form 3NF (third normal form) relations.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd