Question: I need help with my Java class, i saw another response to this lab in Chegg, but is waay bad. I'm stuck, make sure that
I need help with my Java class, i saw another response to this lab in Chegg, but is waay bad.
I'm stuck, make sure that the output prints the name of the cities in upper case with the "to" in lower case between the city string. This is what I have so far
import java.util.ArrayList; import java.util.List; import java.util.Scanner;
public class Itinerary {
public static void main(String[] args) { List
while(flag) { System.out.println("Destination: "); // city = input.next();
if(city.equalsIgnoreCase("done")) { flag= false; // } itinerary.add(city); } // starts at index 0| until the list's size minus 1| one at a time for (int i = 0; i

Lab Itinerary CSIS-1410 Instructions: Sample output: Write a program that does the following: Destination London Create an ArrayList of Strings and call it itinerary Destination: Paris Read in destinations from the user until the user enters done (or DONE, Destination: Rome or donE, As you read in the destinations add them to the itinerary Next You need to create a string called travelRoute that includes the travel Destination done route as shown in the output Use a StringBuilder called sb to create the String travelRoute travel route Loop through all the elements of the ArrayList itinerary LONDON to PARIS to ROME Change the destinations (e.g. Rome) to all uppercase letters (e.g. ROME) before adding them to sb Add the word to (lowercase) between the destinations, but not at the end) When you are done create the string travelRoute based on the information stored in sb. Print the String travelRoute
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
