Henry Z.

asked • 12/16/22

java question.

DATA BLOCK - city list and time difference from EST
String[] cities = { "London", "Paris", "Rome", "Seattle", "Tokyo" };
int[] timeDeltas = { 6, 7, 8, -3, -12 };
// TODO: create the ArrayList of TimeDifference objects using
new operator
// TODO: load the array list with the data with a regular for loop
//for (int i = 0; i < cities.length; i++)
{
// TODO: instantiate each TimeDifference object and add it
the ArrayList
}
// TODO: create Scanner object
// create a variable to hold a Time object reference
Time inputTime;
// prompt for a valid current time
inputTime = getValidTime(input);
// flush input buffer stream
input.nextLine();
// TODO: prompt for desired city name and receive input String
// TODO: loop to prompt user for city and call findCityTime or quit

1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.