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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 07:00, candiceforever123
Idon understand these and need some ! ?
Answers: 2
image
Computers and Technology, 22.06.2019 22:30, kierafisher05
What is the most popular genre of video games?
Answers: 1
image
Computers and Technology, 23.06.2019 03:30, natalie2sheffield
Hashtags serve to identify the topic of a given tweet true false
Answers: 2
image
Computers and Technology, 23.06.2019 21:20, nathanfletcher
In microsoft word, when you highlight existing text you want to replace, you're in              a.  advanced mode.    b.  automatic mode.    c.  basic mode.    d.  typeover mode
Answers: 1
You know the right answer?
Set nummatches to the number of elements in uservalues (having num_vals elements) that equal matchva...

Questions in other subjects:

Konu
Mathematics, 29.11.2020 14:00
Konu
Arts, 29.11.2020 14:00
Konu
Mathematics, 29.11.2020 14:00
Konu
Mathematics, 29.11.2020 14:00