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
If I were to delete a file on a school Chromebook on Chrome OS, would teachers have some special way of seeing it?
Maslowich
Am not sure
Hope I helped
3 0
3 years ago
________________ is broad term used to describe the many web-based tools that enable computer-mediated interpersonal, group, and
icang [17]

Answer:

Social Media

Explanation:

4 0
3 years ago
Pleasee help in this ​
lutik1710 [3]

Answer:

virtual reality glasses

In a VR setting, students can interact with what they see as if they were really there. In addition to providing students with immersive learning experiences, other benefits of virtual reality in education include the ability to inspire students' creativity and spark their imaginations.

Virtual reality headsets are being currently used as a means to train medical students for surgery. It allows them to perform essential procedures in a virtual, controlled environment. Students perform surgeries on virtual patients, which allows them to acquire the skills needed to perform surgeries on real patients.

7 0
3 years ago
Consider the following code segment. The code is intended to read nonnegative numbers and compute their product until a negative
leonid [27]

Answer:

Option D The negative number entered to signal no more input is included in the product

Explanation:

Given the code as follows:

  1.        int k = 0;
  2.        int prod = 1;
  3.        while (k>=0)
  4.        {
  5.            System.out.println("Enter a number: ");
  6.            k= readInt( );
  7.            prod = prod*k;
  8.        }
  9.        System.out.println("product: "+prod);

The line 7 is a logical error. Based on the while condition in Line 3, the loop shall be terminated if k smaller than zero (negative value). So negative value is a sentinel value of this while loop. However, if user enter the negative number to k, the sentinel value itself will be multiplied with prod in next line (Line 7) which result inaccurate prod value.

The correct code should be

  1.        int k = 0;
  2.        int prod = 1;
  3.        while (k>=0)
  4.        {
  5.            prod = prod*k;
  6.            System.out.println("Enter a number: ");
  7.            k= readInt( );
  8.        }
  9.        System.out.println("product: "+prod);
5 0
3 years ago
- Truncate command response time is ______ as comparedto Delete command.
MArishka [77]

Answer:

c. Better

Explanation:

Truncate command response time is better as compared to Delete command.

8 0
3 years ago
Other questions:
  • The benefits of flextime include:
    11·2 answers
  • ​______________________ is a general security term that includes computer​ viruses, worms, and trojan horses.
    13·1 answer
  • Technologies are having a negative impact on businesses.
    8·1 answer
  • During which phase of film making does the team outline their vision for the film?
    5·1 answer
  • Which question about whale sharks is nonscientific?
    11·2 answers
  • Which of the following technologies is an example of social media
    12·1 answer
  • The _________ operator returns the distance in bytes, of a label from the beginning of its enclosing segment, added to the segme
    9·1 answer
  • You are asked to write a program that will display a letter that corresponds with a numeric rating system. The program should us
    7·1 answer
  • What is the small picture or icon on the screen whose position is controlled by the mouse?
    12·1 answer
  • How to resize an image in photoshop without losing quality.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!