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

  Business benefits that especially for you jewelers company

A technical term paper that I need done. Please include title page and reference page with references. This term paper needs to be in APA style. Include page numbers at the top right corner of each page.  The title page includes: title, name, date, c..

  Review and discuss methods for it manager

Review and discuss methods for IT managers to maintain their skills while gaining new managerial skills

  How can you delete the windows old folder

How can you delete the Windows old folder.

  Entity process and code quality

Define a measure that can be used to judge a code's quality. Name one situation you could use this measure

  Provide an implementation of the mymaximum function

Provide an implementation of the mymaximum function whose declaration is shown above. The first argument of the function is an array of int and the second argument is the number of ints that are in the array. The function returns the largest int t..

  A consistent pattern or does it have peaks and valleys

How many requests from users does ESPN receive each second? Do you think this is a consistent pattern or does it have peaks and valleys? When does it peak?

  Identify and correct the errors

Identify and correct the erros in the following program. void nPrintln(string message, int n){int n=1;for (int i=0; i int main (){nPrintln(5, "Welcome to C++!");}

  Logging in to omnymbus

STEP 1: Logging in to Omnymbus Back to Top •Look at your email account to obtain the MySQL/Omnymbus account and password that your Professor has emailed to you. •To help you log into MySQL Omnymbus environment, download the tutorial Login MySQL ..

  What are influences of politics and culture on dss design

What are the influences of politics and culture on DSS design?

  Explain file containing sporting goods which are sold online

You have file containing sporting goods which are sold online. Each item record contains item id, item name, item description, item category, item price, and units in stock.

  Create analysis and design project by part of local business

Recognize part of local business or organization which you can use for analysis and design project. You must explain the scope of project.

  The menu structure for holiday travel vehicle

The menu structure for Holiday Travel Vehicle

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