Question: Use scnr to read integer entryNumber from input until the next entryNumber read is equal to - 9 9 . If entryNumber is not equal

Use scnr to read integer entryNumber from input until the next entryNumber read is equal to -99. If entryNumber is not equal to -99:
Assign currCity with a new City object.
Use currCity's readDetails() method to read the city's population and name from input.
Append currCity to ArrayList cityList.
Ex: If the input is:
14800 Hanna 24700 Davids 33200 Yonder 41500 Barge -99
then the output is:
City population: 4800, Name: Hanna City population: 4700, Name: Davids City population: 3200, Name: Yonder City population: 1500, Name: Barge

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 Programming Questions!