Question: 5 2 8 0 4 0 . 3 4 8 9 5 2 8 . 9 3 z q y 7 Jump to level 1

528040.3489528.93zqy7
Jump to level 1
Given the integer array yearlySalaries with the size of NUM_VALUES, assign numMatches with the number of integers in userValues that are equal to 1.
Ex: If the input is 45
Number of 1 s in array: 4
import java.util.Scanner;
public class ArrayComparison {
public static void main(String[] args){
Scanner scnr = new Scanner(
System.in);
final int NUM_VALUES =6;
int [] yearlySalaries = new int [NUM_VALUES];
int i;
int numMatches;
for yearlySalaries.length; ++i){
}
yearlysalaries [i]=scnr. nextInt () ;
Y* Your code goes here */
System.out.println("Number of 1s in array: "+ numMatches);
1
2
3
 528040.3489528.93zqy7 Jump to level 1 Given the integer array yearlySalaries with

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!