Question: [ after 9 . 1 1 ] In this chapter's FlightTimes class, modify the ? b a r displayFlightTimesTable method by converting the two for

[after 9.11] In this chapter's FlightTimes class, modify the ?bar
displayFlightTimesTable method by converting the two for loops that iterate
over the columns, so that they use for-each loops instead.
Note: There's no comparable benefit to converting the for loop that iterates over the rows.
Why? Because if it's converted to a for-each loop, then there's no row index variable, and
that variable is needed later on as an index into the cities array:
System.out.printf(CITY_FMT_STR, cities[row]);
[ after 9 . 1 1 ] In this chapter's FlightTimes

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!