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

  System knows the ip address and ethernet address of server

assume that your system already knows the IP address and Ethernet address of the web server www1.anyorg.com (so you do not have to do a DNS lookup or ARP request). Fill in the missing information that would be contained in the Ethernet frame as it..

  Identify occasions when you might insert pictures

1) Identify occasions when you might insert pictures into a Word document. Provide specific examples. 2) Identify occasions when you might use a table in a Word document. Provide specific examples.

  Write c program to find the number of occurrences of a word

Write C program to find the number of occurrences of a word from a file given in a specified path. For this you need to give your text file path with some text, and specify the word for which you need to find the frequency.

  Explain most of the various models of the shinkansen

Most of the various models of the Shinkansen, Japan's high-speed trains, travel between 240 km/h and 285 km/h. The two exceptions are the Shinkansen "0" series, which began service in 1964, and the new "500" series, which began service in 1997. Se..

  Design an application of three type of arrays

Design an application that includes three arrays of type int.Allow the user to enter values into the first two.Write a method to store the product of the two arrays in the third array. Produce a display that shows the contents of all three arrays ..

  Are robots remotely controlled by humans really robots

Are robots remotely controlled by humans really robots?

  Write a java program recursively and iteratively

write a java program recursively and iteratively that reads an integer of up to five digits. Write it out individually in both forward and backward order.

  Write the communication in the neuron work

Write down the communication within the neuron work? Write down the communication between the neuron work?

  Define a class to represent time

Define a class to represent time, in military format. Your class should have three private data members.

  What is the number of juggling patterns of length

a. What is the number of juggling patterns of length 2 using at most 3 balls? b. Write the stack numbers for the patterns of part (a). c Write the tables for these juggling patterns.

  How would you ensure that the diagnosis is correct

There is a diagnosis of a bad video card on a client's computer made by another technician. The client would like to have a new video card installed on the desktop. How would you ensure that the diagnosis is correct

  Design a database using the following information

Design a database using the following information. Using Microsoft Vision 2013, create a complete E-R Diagram in Crow's Foot notation (including entity names, attributes, primary keys and foreign keys) that can be implemented, and then implement it i..

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