1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Lapatulllka [165]
3 years ago
14

Assign numMatches with the number of elements in userValues that equal matchValue. userValues has NUM_VALS elements. Ex: If user

Values is {2, 1, 2, 2} and matchValue is 2 , then numMatches should be 3. Your code will be tested with the following values: userValues: {2, 1, 2, 2}, matchValue: 2 userValues: {0, 0, 0, 0}, matchValue: 0 userValues: {20, 50, 70, 100}, matchValue: 10 import java.util.Scanner; public class FindMatchValue { public static void main (String [] args) { Scanner scnr = new Scanner(System.in); final int NUM_VALS = 4; int[] userValues = new int[NUM_VALS]; int i; int matchValue; int numMatches = -99; // Assign numMatches with 0 before your for loop matchValue = scnr.nextInt(); for (i = 0; i < userValues.length; ++i) { userValues[i] = scnr.nextInt(); } /* Your solution goes here */ System.out.println("matchValue: " + matchValue + ", numMatches: " + numMatches); } }
Engineering
1 answer:
Thepotemich [5.8K]3 years ago
8 0

Answer:

import java.util.Scanner;

public class FindMatchValue {

  public static void main (String [] args) {

     Scanner scnr = new Scanner(System.in);

     final int NUM_VALS = 4;

     int[] userValues = new int[NUM_VALS];

     int i;

     int matchValue;

     int numMatches = -99; // Assign numMatches with 0 before your for loop

     matchValue = scnr.nextInt();

     for (i = 0; i < userValues.length; ++i) {

        userValues[i] = scnr.nextInt();

     }

     /* Your solution goes here */

         numMatches = 0;

     for (i = 0; i < userValues.length; ++i) {

        if(userValues[i] == matchValue) {

                       numMatches++;

                }

     }

     System.out.println("matchValue: " + matchValue + ", numMatches: " + numMatches);

  }

}

You might be interested in
ANSWER QUICK<br>Why did Winston Churchill take over for Neville Chamberlain shortly after ww2? ​
kenny6666 [7]

Answer:neville chamberlain died

Explanation:

4 0
3 years ago
Four of the minterms of the completely specified function f(a, b, c, d) are m0, m1, m4, and m5.
Sveta_85 [38]

Complete Question

The complete question is shown on the first uploaded image

Answer:

a) The required additional minterms  for f so that f has eight primary implicants with two literals and no other prime implicant are m_{2},m_{3},m_{7},m_{8},m_{11},m_{12},m_{13},m_{14} and m_{15}

b) The essential prime implicant are c' d',a'b',ab and cd

c) The minimum sum-of-product expression for f are

                  a'b' +ab +c'd'+cd+a'c',\\ a'b'+ab+c'd'+cd+a'd,\\a'b'+ab+c'd'+cd+bc'  and  \\ a'b'+ab+c'd' +cd+bd

Explanation:

The explanation is shown on the second third and fourth image

8 0
3 years ago
For welding the most important reason to use jigs and fixtures in a welding shop is to
diamong [38]

Answer:

Reduce manufacturing costs.

Explanation:

Hope This Helps

Have A Great Day

7 0
2 years ago
Substances A and B have retention times of 16.63 and 17.63 min, respectively, on a 30 cm column. An unretained species passes th
Svet_ta [14]

Answer:

The time required to elute the two species is 53.3727 min

Explanation:

Given data:

tA = retention time of A=16.63 min

tB=retention time of B=17.63 min

WA=peak of A=1.11 min

WB=peak of B=1.21 min

The mathematical expression for the resolution is:

Re_{s} =\frac{2(t_{B}-t_{A})}{W_{A}+W_{B} } =\frac{2*(17.63-16.63)}{1.11+1.21} =0.8621

The mathematical expression for the time to elute the two species is:

\frac{t_{2}}{t_{1}} =(\frac{Re_{B} }{Re_{s} } )^{2}

Here

ReB = 1.5

t_{2} =t_{1} *(\frac{Re_{B} }{Re_{s} } )^{2} =17.63*(\frac{1.5}{0.8621} )^{2} =53.3727min

6 0
3 years ago
Frank D. Drake, an investigator in the SETI (Search for Extra-Terrestrial Intelligence) program, once said that the large radio
AlexFokin [52]

Answer:

attached below

Explanation:

4 0
3 years ago
Other questions:
  • The following laboratory tests are performed on aggregate samples:a. Specific gravity and absorptionb. Soundnessc. Sieve analysi
    13·1 answer
  • What is Not considered as metric system ? a. Length b. Mass c. Time d. Volume e. Temperature
    9·2 answers
  • Storing parts outside doesn't cause any environmental risks as long as the items are covered.
    12·2 answers
  • The MOST common injury causing absence from work is
    7·2 answers
  • Just need someone to talk to pls dont just use me for points
    5·1 answer
  • Why might there be multiple foremen on one work site?
    11·1 answer
  • HOLA COMO ESTAN TODOS
    14·1 answer
  • What is the best countermeasure against social engineering?
    11·1 answer
  • Hello, I have a question, I would be glad if you can help.
    5·1 answer
  • How could angela use the puzzle to model semiconductors? as an n-type semiconductor with the pegs representing electrons and the
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!