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
Car insurance incentives and discounts are available depending on _____. A. school attendance and driver skill B. vehicle type a
WARRIOR [948]

Answer:D. Location, vehicle type, and driving habits

5 0
2 years ago
Read 2 more answers
If you were to plot the voltage versus the current for a given circuit, what would you expect the slope of the line to be? If no
Brut [27]

Answer:

Part 1: It would be a straight line, current will be directly proportional to the voltage.

Part 2: The current would taper off and will have negligible increase after the voltage  reaches a certain  value. Graph attached.

Explanation:

For the first part, voltage and current have a linear relationship as dictated by the Ohm's law.

V=I*R

where V is the voltage, I is the current, and R is the resistance. As the Voltage increase, current is bound to increase too, given that the resistance remains constant.

In the second part, resistance is not constant. As an element heats up, it consumes more current because the free sea of electrons inside are moving more rapidly, disrupting the flow of charge. So, as the voltage increase, the current does increase, but so does the resistance. Leaving less room for the current to increase. This rise in temperature is shown in the graph attached, as current tapers.

7 0
3 years ago
Internal service quality means that an entire organization,
svetoff [14.1K]
True

Internal service are base on customer needs.

The customers are the priority
7 0
2 years ago
Reducing the CFM through the evaporator will cause the amount of moisture removed from the air to ____________________. A. stay
vodomira [7]

Answer:

C. increase

Explanation:

Pollution can be defined as the physical degradation or contamination of the environment through an emission of harmful, poisonous and toxic chemical substances.

On a related note, particulate pollution is a form of pollution that is responsible for the degradation of the environment.

Particulate matter is also referred to as particle pollution or atmospheric aerosol particles and it can be defined as a complex microscopic mixture of liquid droplets and solid particles that are suspended in air. Other forms of particle pollution includes space debris and marine debris. Some examples of particulate pollution are dusts, soot, dirt, smoke, etc.

Generally, when cubic feet-per-minute (CFM) are reduced through the use of an evaporator, it will cause the amount of moisture removed from the air to increase.

3 0
3 years ago
What should be done to denote the end of a topic?
damaskus [11]

Answer:

Include a topic sentence. Conclusions should always begin with a topic sentence.

Use your introductory paragraph as a guide.

Summarize the main ideas.

Appeal to the reader's emotions.

Include a closing sentence.

Explanation:

Hope this help

8 0
2 years ago
Other questions:
  • A roller-coaster car is traveling at a speed of 23 m/s when it passes through point B. At that point, it enters a concave down c
    8·1 answer
  • Hey, can anyone tell me if Igneous rock is good to build on? Cheers!
    6·1 answer
  • Air (ideal gas) is contained in a cylinder/piston assembly at a pressure of 150 kPa and a temperature of 127°C. Assume that the
    12·1 answer
  • What is the relative % change in P if we double the absolute temperature of an ideal gas keeping mass and volume constant?
    14·1 answer
  • What are the mechanical properties of a geotextile that are of most importance when using it as a separator in an unpaved road s
    12·1 answer
  • Find the general solution of the equation<br>a) Tan A = 1/√3​
    11·1 answer
  • Consider a machine of mass 70 kg mounted to ground through an isolation system of total stiffness 30,000 N/m, with a measured da
    9·1 answer
  • A demand factor of _____ percent applies to a multifamily dwelling with ten units if the optional calculation method is used.
    14·1 answer
  • Why data structure is important
    5·1 answer
  • Motors are used to convert electrical energy into mechanical work and the output mechanical work of a motor is rated in horsepow
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!