subject

Set nummatches to the number of elements in uservalues (having num_vals elements) that equal matchvalue. ex: if matchvalue = 2 and uservalues = {2, 2, 1, 2}, then nummatches = 3.
import java. util. scanner;
public class findmatchvalue {
public static void main (string [] args) {
final int num_vals = 4;
int[] uservalues = new int[num_vals];
int i = 0;
int matchvalue = 0;
int nummatches = -99; // assign nummatches with 0 before your for loop
uservalues[0] = 2;
uservalues[1] = 2;
uservalues[2] = 1;
uservalues[3] = 2;
matchvalue = 2;

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 00:30
Which of the following would you find on a network
Answers: 3
question
Computers and Technology, 24.06.2019 01:00
Me if you do then you get 10 points and brainliest
Answers: 1
question
Computers and Technology, 24.06.2019 07:00
Guys do you know sh27 cause he hacked me : ( pidgegunderson my old user
Answers: 2
question
Computers and Technology, 25.06.2019 00:00
What function key is used to enable the spelling and grammar function
Answers: 1
You know the right answer?
Set nummatches to the number of elements in uservalues (having num_vals elements) that equal matchva...
Questions
question
Mathematics, 17.12.2020 05:00
question
Mathematics, 17.12.2020 05:00
question
Mathematics, 17.12.2020 05:00
question
Mathematics, 17.12.2020 05:00
question
English, 17.12.2020 05:00
question
Mathematics, 17.12.2020 05:00
question
Mathematics, 17.12.2020 05:00
Questions on the website: 13722362