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:20
Avolume of 2.65 m3 of air in a rigid, insulated container fitted with a paddle wheel is initially at 264 k, 5.6 bar. the air receives 432 kj by work from the paddle wheel. assuming the ideal gas model with cv = 0.71 kj/kg • k, determine for the air the amount of entropy produced, in kj/k
Answers: 2
question
Engineering, 04.07.2019 19:20
Acarnot refrigerator operates in a room in which the temperature is 21°c and of power when operating. if the food compartment of the refrigerator is consumes 3 kw to be maintained at 2°c, determine (a) the coefficient of performance of the cycle and (b) the rate of heat removal from the food compartment. refrigerator cycle that has a higher coefficient of performance than that of the discussed (e) is it possible to develop a carn ot refrigerator, operating between the same temperature limits? explain
Answers: 2
question
Engineering, 06.07.2019 02:30
On solidification from a melt, the polymer polyethylene forms a semi-crystalline spherulite structure. (i) sketch an individual spherulite and label the amorphous and crystalline regions. (ii) draw a schematic to show the changes in specific volume with temperature during cooling from the melt, comparing it to the theoretical extremes of fully crystalline and fully amorphous (indicate tm and tg)
Answers: 2
question
Engineering, 06.07.2019 04:10
Apinion having 30 involute teeth of 6,5 module rotates at 220 r/min and transmits 2 kw to a gear wheel having 70 teeth; the addendum on both wheels is 4 of the circular pitch and the angle of obliquity is 200. determine; 3.1 the lengths of the path of approach and the arc of approach 3.2 the normal force between the teeth at an instant when there is only one pair of teeth in contact
Answers: 2
You know the right answer?
Assign nummatches with the number of elements in uservalues that equal matchvalue. uservalues has nu...
Questions
question
Chemistry, 16.09.2019 00:20
question
Mathematics, 16.09.2019 00:20