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, 22.06.2019 11:00
Technician a says that the radiator usually cools better if the front air dam is removed. technician b says that when a condenser has a leak it can be repaired easily with epoxy. who is correct?
Answers: 1
question
Computers and Technology, 22.06.2019 20:00
What is used to analyze and summarize your data without graphical support
Answers: 1
question
Computers and Technology, 23.06.2019 09:30
The place where the extended axis of the earth would touch the celestial sphere is called the celestial
Answers: 1
question
Computers and Technology, 23.06.2019 13:00
Which one of the following voltages should never be measured directly with a vom? a. 1200 v b. 500 v c. 800 v d. 100v
Answers: 2
You know the right answer?
Set nummatches to the number of elements in uservalues (having num_vals elements) that equal matchva...
Questions
question
Mathematics, 20.11.2021 06:20
question
Business, 20.11.2021 06:20