subject
Engineering, 19.11.2019 02:31 mia1518

Assign nummatches with the number of elements in uservalues that equal matchvalue. uservalues has num_vals elements. ex: if uservalues 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); } }

ansver
Answers: 2

Another question on Engineering

question
Engineering, 04.07.2019 18:10
Asingle-geared blanking press has a stroke of 200 mm and a rated capacity of 320 kn. a cam driven ram is assumed to be capable of delivering the full press load at constant force during the last 15 percent of a constant-velocity stroke. the camshaft has an average speed of 90 rev/min and is geared to the flywheel shaft at a 6: 1 ratio. the total work done is to include an allowance of 16 percent for friction a) estimate the maximum energy fluctuation b) find the rim weight for an effective diameter of 1.2 m and a coefficient of speed fluctuation of 0.10
Answers: 1
question
Engineering, 04.07.2019 18:10
Afull journal bearing has a journal diameter of 27 mm, with a unilateral tolerance of -0.028 mm. the bushing bore has a diameter of 27.028 mm and a unilateral tolerance of 0.04 mm. the l/d ratio is 0.5. the load is 1.3 kn and the journal runs at 1200 rev/min. if the average viscosity is 50 mpa-s, find the minimum film thickness, the power loss, and the side flow for the minimum clearance assembly.
Answers: 1
question
Engineering, 04.07.2019 18:10
The filament of an incandescent lamp has a temperature of 2000k. calculate the fraction of radiation emitted in the visible light band if the filament is approximated as blackbody
Answers: 2
question
Engineering, 04.07.2019 18:10
Atmospheric air has a temperature (dry bulb) of 80° f and a wet bulb temperature of 60° f when the barometric pressure is 14.696 psia. determine the specific humidity, grains/lb dry air. a. 11.4 c. 55.8 d. 22.5 b. 44.1
Answers: 1
You know the right answer?
Assign nummatches with the number of elements in uservalues that equal matchvalue. uservalues has nu...
Questions
Questions on the website: 13722367