Question: Write the inputTowns ( ) method in the SmallCities class. Within inputTowns ( ) , use scnr to read each row number until - 1

Write the inputTowns() method in the SmallCities class. Within inputTowns(), use scnr to read each row number until -1 is read from input. If the row number is not equal to -1:
Create a new Town object.
Use the Town object's readNameAndRating() method to read the town's name and rating from input.
Append the Town object to ArrayList townList.
Ex: If the input is:
1 Gillette A 2 Hanna A 3 Goshen B -1
then the output is:
Town: Gillette, Rating: A Town: Hanna, Rating: A Town: Goshen, Rating: B

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!