1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ELEN [110]
1 year ago
13

Input a list of employee names and salaries and store them in parallel arrays. End the input with a sentinel value. The salaries

should be floating point numbers Salaries should be input in even hundreds. For example, a salary of 36,510 should be input as 36.5 and a salary of 69,030 should be entered as 69.0. Find the average of all the salaries of the employees. Then find the names and salaries of any employee who's salary is within 5,000 of the average. So if the average is 30,000 and an employee earns 33,000, his/her name would be found. Display the following using proper labels. Save your file using the naming format LASTNAME_FIRSTNAME_M08 FE. Turn in your file by clicking on the Start Here button in the upper right corner of your screen. 1.Display the names and salaries of all the employees. 2. Display the average of all the salaries 3. Display all employees that are within 5,000 range of the average.
Computers and Technology
1 answer:
4vir4ik [10]1 year ago
5 0

Using the knowledge in computational language in JAVA it is possible to write the code being Input a list of employee names and salaries and store them in parallel arrays

<h3>Writting the code in JAVA:</h3>

<em>BEGIN</em>

<em>DECLARE</em>

<em>employeeNames[100] As String</em>

<em>employeeSalaries[100] as float</em>

<em>name as String</em>

<em>salary, totalSalary as float</em>

<em>averageSalary as float</em>

<em>count as integer</em>

<em>x as integer</em>

<em>rangeMin, rangeMax as float</em>

<em />

<em>INITIALIZE</em>

<em>count = 0;</em>

<em>totalSalary =0</em>

<em />

<em />

<em>DISPLAY “Enter employee name. (Enter * to quit.)”</em>

<em>READ name</em>

<em />

<em>//Read Employee data</em>

<em>WHILE name != “*” AND count < 100</em>

<em />

<em>employeeNames [count] = name</em>

<em>DISPLAY“Enter salary for “ + name + “.”</em>

<em>READ salary</em>

<em>employeeSalaries[count] = salary</em>

<em>totalSalary = totalSalary + salary</em>

<em>count = count + 1</em>

<em />

<em>DISPLAY “Enter employee name. (Enter * to quit.)”</em>

<em>READ name</em>

<em />

<em>END WHILE</em>

<em />

<em>//Calculate average salary with mix , max range</em>

<em>averageSalary = totalSalary / count</em>

<em>rangeMin = averageSalary - 5</em>

<em>rangeMax = averageSalary + 5</em>

<em />

<em>DISPLAY “The following employees have a salary within $5,000 of the mean salary of “ + averageSalary + “.”</em>

<em />

<em>For (x = 0; x < count; x++)</em>

<em>IF (employeeSalaries[x] >= rangeMin OR employeeSalaries[x] <= rangeMax )</em>

<em>DISPLAY employeeNames[x] + “\t” + employeeSalaries[x]</em>

<em>END IF</em>

<em>END FOR</em>

<em>END</em>

See more about JAVA at brainly.com/question/12978370

#SPJ1

You might be interested in
A user is trying to delete a file located on an ntfs volume on his windows 8 computer but is unable to do so. Why is this.
dezoksy [38]

It happened because the window files on that users pc are corrupted and deleted so the user needs to reinstall the windows and then after he should be able to remove that file from his PC.

If the above thing didn't work, follow the following steps.

- Click the start button ,type in cmd then it will show you a command prompt program icon, right click on that and open it by using the administrator rights. Once the program opened then type in chkdsk /f and hit Enter to automatically scan your computer for any corrupted files/ folders upon the restart of the computer.

This will be definitely helpful for you.

4 0
2 years ago
Ask the user to enter a number n &gt;= 1. There after the user will enter n-1 distinct integers between 1 and n. Thus, the enter
snow_tiger [21]

Answer:

Code below

Explanation:

n = int(input('Please enter n: '))#take input n

print('please enter the numbers')#print enter the numbers

total = 0 #intially take total as 0

original_total = 1 #intially take original_total=1

for i in range(2, n+1): #take the range 2 to n+1

total += int(input('Please enter a number: ')) # add total and enter the number

original_total += i

missing = original_total - total #you got missing number original_total - total

print('The missing number is: ' + str(missing)) # print missing number in the given data

3 0
3 years ago
A file has TWo parts name them
lisov135 [29]

Answer:

File name and file extension

Explanation:

4 0
1 year ago
4. True or False? Electrons flow out from the POSITIVE end of a battery. *<br> True<br> False
lana66690 [7]
False electrons put off a negative charge
4 0
3 years ago
If you want a user to enter exactly 20 values, which loop would be the best to use?
Hitman42 [59]

Answer: For loop

Explanation:

Using the for loop we can get the exact number of values/outcomes we require.

For example:    printf(enter 20 numbers");

                               for(int i=0; i<20;i++)

                               {

                                       scanf("%d", &number);

                                }

So, this is an implementation of for loop in C. Using it we can enter exact 20 numbers not less or more than that.

Therefore, for loop is the answer.

4 0
3 years ago
Other questions:
  • What type of wireless connection requires an unobstructed "line of sight" between transmitter and receiver?
    8·1 answer
  • Which information is considered free for use?
    9·2 answers
  • Data ____ travel over the Internet from router to router until reaching their destinations.
    7·1 answer
  • #Write a function called hide_and_seek. The function should #have no parameters and return no value; instead, when #called, it s
    7·1 answer
  • How is the bootstrap program started?
    6·2 answers
  • Given a constant named size with a value of 5, which statement can you use to define and initialize an array of doubles named ga
    12·1 answer
  • Write a program that inputs a five-digit integer, spearates the integer into its digits and prints them seperated by three space
    6·1 answer
  • Explain any two features of a computer​
    15·1 answer
  • True or false altering iso will affect the area of focus in a photo
    13·1 answer
  • What does the word collaborative mean?
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!