Question: 5 2 8 0 4 0 . 3 4 8 9 5 2 8 . 9 3 2 9 y 7 Jump to level 1

528040.3489528.9329y7
Jump to level 1
Integer arrays busNumbers and numPeople are read from input, containing the numbers and number of people of each bus. Initialize variable count with 0. For each bus, increment count if a bus meets both of the following conditions:
Number is an even integer.
Number of people is greater than 30.
Lastly, output count followed by a newline.
Ex: For the input:
158,197,163,111,138
47,27,21,30,48
then the output is:
2
int [] busNumbers = new int [NUM_VALS];
int [] numPeople = new int[NUM_VALS];
int i;
int count;
for NUM_VALS; ++i
busNumbers [i]=scnr. nextInt () ;
}
for NUM_VALS; ++i
numpeople[i]=scnr*nextInt();
}
I* Your code goes here */
 528040.3489528.9329y7 Jump to level 1 Integer arrays busNumbers and numPeople are

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!