Salary x Compile Undo Cut Соpy Paste Find... Close Source Code import java.util.Scanner; /** * Midterm programming question * Provided below is an incomplete Java Program * Follow the instructions in...


I want help fixing this error.


Salary x<br>Compile<br>Undo<br>Cut<br>Соpy<br>Paste<br>Find...<br>Close<br>Source Code<br>import java.util.Scanner;<br>/**<br>* Midterm programming question<br>* Provided below is an incomplete Java Program<br>* Follow the instructions in the comments to complete this program<br>* A sample run results will be provided separately<br>*<br>*/<br>public class Salary<br>{<br>public static void main(String[] args){<br>String[] names<br>double[] salaries<br>Scanner input<br>new String[3];<br>new double[3];<br>= new Scanner(System.in);<br>%3D<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 import java.util.Scanner; /** * Midterm programming question * Provided below is an incomplete Java Program * Follow the instructions in the comments to complete this program * A sample run results will be provided separately * */ public class Salary { public static void main(String[] args){ String[] names double[] salaries Scanner input new String[3]; new double[3]; = new Scanner(System.in); %3D // 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 for(int i = 0; i< 3;="" i++)="" {="" system.out.println("please="" enter="" 3="" employee="" names");="" names[i]="input.nextLine();" %3d="" 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?"="" for(int="" i="0;"><3; i++){="" system.out.println("what="" is="" the="" salary="" of"+names[i]);="" salaries[i]="input.nextDouble();" }="" then,="" modify="" the="" statements="" below="" to="" print="" out="" the="" average="" salary="" of="" al1="" employees="" and="" the="" name="" of="" the="" employee="" with="" the="" highest="" salary="" you="" should="" invoke="" the="" methods="" index0fhighest(),="" and="" getarrayaverage().="" saved="" errors:="">
Salary x<br>Compile<br>Undo<br>Cut<br>Сopy<br>Paste<br>Find...<br>Close<br>Source Code<br>// The program should prompt the user with employee names, like:<br>// input[highestIndex]) highestIndex return highestIndex; } i; 스 saved Errors: 1 "/>
Extracted text: Salary x Compile Undo Cut Сopy Paste Find... Close Source Code // The program should prompt the user with employee names, like: // "What is the salary of Xiaoxing?" for (int i System.out.println("What is the salary of"+names[i]); salaries[i] = input.nextDouble(); 0; i<3; i++)="" {="" then,="" modify="" the="" statements="" below="" to="" print="" out="" the="" average="" salary="" of="" all="" employees="" 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:%.2f\n",getarrayaverage="" (salaries));="" system.out.println("the="" employee="" with="" the="" highest="" salary="" is:"+names[index0fhighest(salaries)]);="" incompatible="" types:="" double[]="" cannot="" be="" converted="" to="" int[]="" }="" private="" static="" double="" getarrayaverage="" (double[]="" input){="" double="" sum="" :%3b="" for="" (double="" val:input)="" sum+="val;" return="" sum/input.length;="" private="" static="" int="" index0fhighest(int[]="" input){="" int="" highestindex="0%;" for(int="" i="0;iinput[highestIndex])" highestindex="" return="" highestindex;="" }="" i;="" 스="" saved="" errors:="">

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here