answersLogoWhite

0


Best Answer

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

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Pseudocode input list employee name and salaries average?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Input a list of employee names and salaries and determine the mean average salary as well as the number of salaries above and below the mean?

Declare Names[100], Salaries[100]Set Sum = 0Set Count1 = 0Set K = 1Write "Enter Employees Name and Salary."Write "Enter *,0 when done."Input Name, SalaryWhile Salary "0"Set Count1 = Count1 + 1Set Sum = Sum + SalaryWrite "Enter another Employee Name and Salary (enter *,0 when done)"Input Name, SalaryEnd WhileSet Average = Sum / Count1Set Count2 = 0Set Count3 = 0For K = 1 Step 1 to Count1If Salary[K] > Average ThenSet Count2 = Count2 + 1End IfIf Salary[K] < Average ThenSet Count3 = Count3 + 1End IfEnd ForWrite "The Average Salary is: $", AverageWrite "The number of Salaries Above theAverage Salary is:", Count2Write "The number of Salaries Below theAverage Salary is:", Count3


How do you write a pseudocode with conditions?

Start Input x, y ; If (x


How do you write the pseudocode for an application that accepts a number as input and displays the number three times?

input number for loop = 1 to 3 inclusive print number end for


How do you write a pseudocode program that commutes and displays a 15 percent tip when you input the price of the meal?

input price calc tip = price*0.15 print tip


Explain employee mistrust as a challenge of MIS?

People are naturally afraid of MIS technology, ie ...how will it be used... against them? Consistency and reliability of input by employee, managements reaction or inaction regarding employee input.


What is the pseudocode for converting Fahrenheit to Celsius?

Oh, converting Fahrenheit to Celsius is like painting a happy little tree. Here's a simple pseudocode for you: Input the temperature in Fahrenheit Subtract 32 from the Fahrenheit temperature Multiply the result by 5/9 to get the temperature in Celsius Just remember, there are no mistakes in pseudocode, only happy little accidents.


Where is the error in the following pseudocode Display enter the length of the room input length Declare Integer length?

The order of operations. Variables must be declared before they are used.


Draw a flowchart that will ask the user to enter 10 numbers and calculate the average?

PERFORM GET_ NUMBER 10 TIMES AVERAGE = AVERAGE/10 GET_NUMBER: INPUT = a$ AVERAGE = AVERAGE + INPUT


Write a pseudocode statement that declares the variable total so it can hold integers Initialize the variable with the value 0?

Declare Real price=49.95 Display "the original price." Input item original price Display "price"


How do I write a pseudocode algorithm which inputs numeric scores and outputs how many of them are over 100. The end of the data is signalled by a user input of -1.?

101


Create a non-GUI based Java application that calculates weekly pay for an employee.?

public class Payroll { // main method begins execution of Java application public static void main( String args[] ) { // create Scanner to obtain input from command window Scanner input = new Scanner( System.in ); char name; // employee's name int number1; // hourly rate int number2; // number of hours worked for the week int product; // product of number1 and number2 System.out.print( "Enter employee's name: " ); // prompt user to input name name = input.nextLine(); //read employee's name from user's input System.out.print( "Enter hourly rate: " ); // prompt user for employee's hourly rate number1 = input.nextInt(); // read hourly rate from user's input System.out.print( "Enter hours worked for the week: " ); // prompt user to enter number of hours worked for the week number2 = input.nextInt(); // read number of weeks from user's input product = number1 * number2; // multiply numbers System.out.printf( "The Employee" , name ); // displays employee's name System.out.printf( "weekly pay is $%d\n" , product ); // displays weekly pay } // end method main } // end class Payroll


C plus plus program that display an employees name by entering an id?

Ideally you'd want to use a DBMS to store and retrieve the employee data, but we'll keep it simple and use some static data instead.#include#include#include#includestruct employee{std::string m_name;unsigned m_id;employee(std::string name, unsigned id): m_name(name), m_id(id) {}};std::vector employees;void load_data (){employees.push_back (employee ("Alan", 1));employees.push_back (employee ("Brian", 2));employees.push_back (employee ("Charles", 3));employees.push_back (employee ("David", 4));employees.push_back (employee ("Eric", 5));}unsigned input_id (std::string prompt){unsigned id = 0;while (1){std::cout