Question: Given the integer array hourlySalaries with the size of ARR _ VALS, assign numMatches with the number of integers in userValues that are equal to

Given the integer array hourlySalaries with the size of ARR_VALS, assign numMatches with the number of integers in userValues that are equal to 5.
Ex: If the input is 45,39,75,100,106,48,5,71, then the output is:
Number of 5s in array: 1
public class ArrayComparison {
public static void main(String[] args){
Scanner scnr = new Scanner(
System.in);
final int ARR_VALS =8;
int hourlysalaries = new int [ARR_VALS];
int i;
int numMatches;
for hourlySalaries.length; +i{
}
hourlySalaries [i]= scnr. nextInt();
}
System.out.println("Number of 5 s in array: "+ numMatches);
}
 Given the integer array hourlySalaries with the size of ARR_VALS, assign

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!