Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 */
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions