programming concepts

Input a list of employee names and salaries stored in parallel arrays. The sal-aries should be floating point numbers in increments of 100. For example, a salary of $ 36,000 should be input as 36.0 and a salary of $ 85,900 should be input as 85.9. Find the mean ( average) salary and display the names and salaries of employees who earn within a range of $ 5,000 from the mean. In other words, if the mean salary is $ 45,000, all employees who earn between $ 40,000 and $ 50,000 should be displayed.

  1. 👍 0
  2. 👎 2
  3. 👁 1,811
  1. Declare employeeNames[100] As String
    Declare employeeSalaries[100] as float
    Declare name as String
    Declare salary, totalSalary as float
    Declare averageSalary as float
    Declare count as integer
    Set count = 0;
    Set totalSalary =0
    Write “Enter employee name. (Enter * to quit.)”
    Input name
    While name != “*” and count < 100
    Set employeeNames [count] = name
    Write “Enter salary for “ + name + “.”
    Input salary
    Set employeeSalaries[count] = salary
    totalSalary = totalSalary + salary
    Set count = count + 1
    End While
    Set averageSalary = totalSalary / count
    Declare x as integer
    Declare rangeMin, rangeMax as float
    Set rangeMin = averageSalary - 5
    Set rangeMax = averageSalary + 5
    Write “The following employees have a salary within $5,000 of the mean salary of “ + averageSalary + “.”
    For (x = 0; x < count; x++)
    If (employeeSalaries[x] >= rangeMin or employeeSalaries[x] <= rangeMax )
    Write employeeNames[x] + “\t” + employeeSalaries[x]
    End if
    End for

    1. 👍 0
    2. 👎 0

Respond to this Question

First Name

Your Response

Similar Questions

  1. Technology

    Can you pleas check my answers? 1. Which of the following is a list of input devices? A. printer, mouse, speakers (answer) B. RAM, monitor, printer C. microphone, mouse, scanner D. CPU, monitor operation system 2. Which type of

  2. English

    (1) Sale looked at the map one more time. (2) She knew that the whole troop was depending on her. (3) Sal couldn't decide if the trial was to the east or to the west. (4) The map was confusing. (5) Sal was tired. (6) She needed to

  3. Big Data

    Suppose our input data to a map-reduce operation consists of integer values (the keys are not important). The map function takes an integer i and produces the list of pairs (p,i) such that p is a prime divisor of i. For example,

  4. Physics

    Two capacitors are connected in parallel as shown above. A voltage V is applied to the pair. What is the ratio of charge stored on C1 to the charge stored on C2, when C1 = 1.5C2 ? how do you do this? ( The answer is 3/2) Thanks

  1. Fourth grade math

    (1) Courtney has 36 photos to arrange on a gallery walk. Part A How many arrays can Courtney make with the 36 photos? List all the possible arrays. Part B How many factors are there for 36? Write them. What do you notice about the

  2. Language Arts

    In Chapter 40, of Walk of Two Moons, Sal receives the gift of a chicken from Ben. The Chicken's name is Blackberry. Explain the irony in Ben's gift and the name he gives it. Now i know that Blackberries remind Sal of her mother.

  3. Language Arts

    (1) Sal looked at the map one more time. (2) She knew that the whole troop was depending on her. (3) Sal couldn’t decide if the trail was to the east or to the west. (4) The map was confusing. (5) Sal was tired. (6) She needed

  4. Programming

    Develop a Java application that will determine the gross pay for each of three employees. The company pays “straight line” for the first 40 hours worked by each employee and pays “time and a half” for all hours worked in

  1. mathematics

    Pat works in the city and lives in the suburbs with Sal. Every afternoon, Pat gets on a train that arrives at the suburban station at exactly 5 P M . Sal leaves the house before 5 and drives at a constant speed so as to arrive at

  2. LA

    9. Read the following list of plot events from the novel. 1. Phoebe receives a third anonymous message 2. Margaret and Mr. Brikway replant the rhododendron bush. 3. Sal's father discovers the fireplace behind a wall in their

  3. English 10

    Which sentence correctly punctuates a nonessential appositive phrase? A. Aries, one of thirteen constellations in the Zodiac, contains four stars. B. Aries one of thirteen constellations in the Zodiac contains four stars. C.Aries,

  4. Science

    What is the main benefit of using scientific names instead of common names for organisms? Scientific names have been around for much longer than common names have. Scientific names give everyone a shared terminology while common

You can view more similar questions or ask a new question.