answer.
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]
2 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]2 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
thermal energy is being added to steam at 475.8 kPa and 75% quality. determine the amount of thermal energy to be added to creat
eduard

Answer:

q_{in} = 528.6\,\frac{kJ}{kg}

Explanation:

Let assume that heating process occurs at constant pressure, the phenomenon is modelled by the use of the First Law of Thermodynamics:

q_{in} = h_{g} - h_{mix}

The specific enthalpies are:

Liquid-Vapor Mixture:

h_{mix} = 2217.2\,\frac{kJ}{kg}

Saturated Vapor:

h_{g} = 2745.8\,\frac{kJ}{kg}

The thermal energy per unit mass required to heat the steam is:

q_{in} = 2745.8\,\frac{kJ}{kg} - 2217.2\,\frac{kJ}{kg}

q_{in} = 528.6\,\frac{kJ}{kg}

7 0
2 years ago
A pair of spur gears with 20 degree pressure angle, full-depth, involute teeth transmits 65 hp. The pinion is mounted on a shaft
vfiekz [6]

Answer:

See explaination

Explanation:

a) The pitch circle diameter of pinion in inches is given by

Dp=Np/P

Where

Np= No. of teeth in pinion = 26

P =diametral pitch= 6

Hence

Dp= 26/6 = 4.333 in

Pinion angular speed\omega _{p} =1250 rpm = 130.9 rad/s

Therefore pitch line speed

V=Dp/2\omega _{p} = 4.333/2x130.9

= 283.62 in/s

V= 23.63 ft/s

V=1418 ft/min

b) The pitch circle diameter og gear is given by

Dg= Ng/P= 48/6 = 8 in

The center distance is given by

C=(Dp+Dg)/2

= (4.333+8)/2

C= 6.167 in

c) The torque on the pinion is given by

Tp= P/\omega _{p}

Where

P = transmitted power, =65 hp = 65x550= 35750 lt-lb/s

Tp= 35750/130.9

= 273.1 ft-lb

d) Speed ratio is given as

R=Ng/Np= 48/26 = 1.8461

Hence speed of gear is

\omega _{g}=\frac{\omega _{p}}{R}

= 130.9/1.8461

= 70.9 rad/s

Therefore torque on gear is given as

Tg= P/\omega _{g} = 35750/70.9

= 504.2 ft-lb

e) Assuming transmission eficiency of 100%

Output hp=input hp= 65 hp

f) Tangential force on gear teeth is given by

Fgt= Tg/(Dg/2)

= 504.2x2/8

= 126.05 lb

g) Radial force on ger teeth is given as

Fgr= Fgt tan\phi

Where

\phi is pressure angle = 200

Hence

Fgr= 126.05tan200

= 45.88 lb

h) The normal force on gear teeth is given as

F=Fgt/cos\phi

= 126.05/cos200

= 134.14 lb

4 0
2 years ago
Your roommate wants to learn about organizational chart. You can tell her that these charts can tell you all of these about an o
mars1129 [50]

Answer:

Control mechanisms

Explanation:

Organizational chart of any company will give details of different aspects of the company such as the major sub-units of the organization with the names of team leaders for different sub-units, it can also give you the span of control and the division of work within the company. However, the chart can't show you control mechanisms of different departments.

4 0
2 years ago
An annealed copper strip of 228 mm wide and 25 mm thick being rolled to a thickness of 20 mm, in one pass. The roll radius is 30
sdas [7]

Answer:

The roll force is 1.59 MN

The power required in this operation is 644.96 kW

Explanation:

Given;

width of the annealed copper, w = 228 m

thickness of the copper, h₀ = 25 mm

final thickness, hf = 20 mm

roll radius, R = 300 mm

The roll force is given by;

F = LwY_{avg}

where;

w is the width of the annealed copper

Y_{avg} is average true stress of the strip in the roll gap

L is length of arc in contact, and for frictionless situation it is given as;

L = \sqrt{R(h_o-h_f)} \\\\L = \sqrt{300(25-20)}\\\\L = 38.73 \ mm

Now, determine the average true stress, Y_{avg}, for the annealed copper;

The absolute value of the true strain, ε = ln(25/20)

ε = 0.223

from true stress vs true strain graph; at true strain of 0.223, the true stress is 280 MPa.

Then, the average true stress = ¹/₂(280 MPa.) = 180 MPa

Finally determine the roll force;

F = LwY_{avg}

F = (\frac{38.73 }{1000})(\frac{228}{1000})*180 \ MPa\\\\F =   1.59 \ MN

The power required in this operation is given by;

P = \frac{2\pi FLN}{60}\\\\P =  \frac{2\pi (1.59*10^6)(0.03873)(100)}{60}\\\\P = 644955.2 \ W\\\\P = 644.96 \ kW

5 0
2 years ago
The ingredient weights for making 1 yd (cyd) of concrete by assuming aggregates in SSD state are given below. The volume of air
Pachacha [2.7K]

Answer:

Explanation:

Ans) Given batch weight of each component :

Cement = 700 lb

Water = 315 lb

Coarse aggregate = 1575 lb

Fine aggregate = 1100 lb

Part 1) Amount of water = 328.5 lb

Amount of water is needed to be increased if the aggregates has absorption capacity, To maintain constant water cement ratio, the mixing water is increased because some of the water is absorbed by aggregates.

Amount of water absorbed = 328.5 lb - 315 lb = 13.5 lb

Total amount of aggregates = 1575 + 1100 = 2675 lb

=> % Absorption capacity = 13.5 x 100 / 2675 = 0.5 %

Hence, new amount of Coarse aggregate = (1 - 0.005) x 1575 lb = 1567.125 lb

New amount of fine aggregate = (1 - 0.005) x 1100 = 1094.5 lb

Since, water cement ratio is maintained constant , amount of cement remains unchanged

=> Volume of water = 328.5 / 62.4 = 5.26 ft3

=> Volume of cement = 700 / (3.15 x 62.4) = 3.56 ft3

=> Volume of coarse aggregate = 1567.125 / (2.4 x 62.4) = 10.46 ft3

=> Volume of fine aggregate = 1100 / (2.4 x 62.4) = 7.34 ft3

Volume of air = 2% = 0.02 x 27 = 0.54 ft3

Total concrete volume = 5.26 + 3.56 + 10.46 + 7.34 + 0.54 \approx 27 ft3 = 1 yd3

Hence, calculated amount of each component is correct

Part 2) We know, minus sign indicated that the aggregate will absorb some moisture from concrete, hence mixing water amount needed to be corrected .

=> Amount of water absorbed by coarse aggregate = 0.01 x 1567.125 lb = 15.67 lb

=> Amount of water absorbed by fine aggregate = 0.02 x 1094.50 lb = 21.89 lb

Total amount of water absorbed = 15.67 + 21.89 = 37.56 lb

To maintain same water cement ratio, amount of mixing water is needed to be increased

=> Corrected amount of mixing water = 328.5 lb + 37.56 lb = 366 lb

=> Corrected amount of coarse aggregate = (1 - 0.01) x 1567.125 = 1551.45 lb

=> Corrected amount of fine aggregate = (1 - 0.02) x 1094.5 = 1072.6 lb

Part 3) We know,

Unit weight = Sum of weight of each material / Total volume

=> Sum of weight = 366 + 700 + 1551.45 + 1072.6 = 3690.05 lb

Total volume = 1 yd3 or 27 ft3

=> Expected Unit Weight = 3690.05 lb / 27 ft3 = 136.67 lb/ft3

Also, Concrete Yield = Weight of all components / Unit weight of concrete

=> Yield = 3690.05 / 136.67 = 27 ft3 or 1 yd3

4 0
2 years ago
Other questions:
  • A subway car leaves station A; it gains speed at the rate of 4 ft/s^2 for of until it has reached and then at the rate 6 then th
    8·1 answer
  • Given a 5x5 matrix for Playfair cipher a. How many possible keys does the Playfair cipher have? Ignore the fact that some keys m
    6·1 answer
  • Show that a chirped Gaussian pulse is compressed initially inside a single-mode fiber when ftC &lt; 0. Derive expressions for th
    12·1 answer
  • Flow and Pressure Drop of Gases in Packed Bed. Air at 394.3 K flows through a packed bed of cylinders having a diameter of 0.012
    8·1 answer
  • A desktop computer is to be cooled by a fan whose flow rate is 0.34 m3/min. Determine the mass flow rate of air through the fan
    12·1 answer
  • 7. Implement a function factorial in RISC-V that has a single integer parameter n and returns n!. A stub of this function can be
    9·1 answer
  • - Consider a 2024-T4 aluminum material with ultimate tensile strength of 70 ksi. In a given application, a component of this mat
    7·1 answer
  • Benzene vapor at 480°C is cooled and converted to a liquid at 25°C in a continuous condenser. The condensate is drained into 1.7
    15·1 answer
  • What ratio between differential gain and common-mode gain is called​
    9·1 answer
  • How does Accenture generate value for clients through Agile and DevOps?
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!