Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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);
}
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

A Complete Guide To Data Science Essentials

Authors: Miguel

1st Edition

9358684992, 978-9358684995

More Books

Students also viewed these Databases questions

Question

The government protects intellectual property rights because they

Answered: 1 week ago

Question

The company has fair promotion/advancement policies.

Answered: 1 week ago