Salary x Compile Undo Cut Соpy Paste Find... Close Source Code */ public class Salary |{ public static void main(String[] args){ String[] names double[] salaries Scanner input = new...


Complete the uncompleted java program. The sample run is attached below.


Salary x<br>Compile<br>Undo<br>Cut<br>Соpy<br>Paste<br>Find...<br>Close<br>Source Code<br>*/<br>public class Salary<br>|{<br>public static void main(String[] args){<br>String[] names<br>double[] salaries<br>Scanner input = new Scanner(System.in);<br>= new String[3];<br>new double[3];<br>// First, using loop to get 3 employee names from the user, and save them in the array

Extracted text: Salary x Compile Undo Cut Соpy Paste Find... Close Source Code */ public class Salary |{ public static void main(String[] args){ String[] names double[] salaries Scanner input = new Scanner(System.in); = new String[3]; new double[3]; // First, using loop to get 3 employee names from the user, and save them in the array "names" // Hint: to get String values, use input.nextLine() method // Next, using loop to get the salaries of the 3 employees, and save them in the array "salaries" // The program should prompt the user with employee names, like: // "What is the salary of Xiaoxing?" // Then, modify the statements below to print out th // and the NAME of the employee with the highest salary // You should invoke the methods index0fHighest(), and getArrayAverage(). // The average number should have two decimal points System.out.printf("The average salary is: "); // incomplete System.out.println("The employee with the highest salary is: "); average salary of all employees // incomplete private static double getArrayAverage (double[] input){ //This method should return the average of the array elements in the array "input" return 0; // remove this line when you start working %3D private static int index0fHighest(int[] input){ // This method should return the INDEX of the largest element in the array "input" return 0; // remove this line when you start working } saved
Please enter 3 employee names:<br>Liu<br>Bradley<br>Chays<br>Please enter the salary of Liu<br>5000<br>Please enter the salary of Bradley<br>6000<br>Please enter the salary of Chays<br>4500<br>The average salary is: 5166.67<br>The employee with highest salary is: Bradley<br>

Extracted text: Please enter 3 employee names: Liu Bradley Chays Please enter the salary of Liu 5000 Please enter the salary of Bradley 6000 Please enter the salary of Chays 4500 The average salary is: 5166.67 The employee with highest salary is: Bradley
Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here