Answered step by step
Verified Expert Solution
Question
1 Approved Answer
What is the code in Java? USE STRINGBUILDER... Sample Output Destination: London Destination: Paris Destination: Rome Destination: done Instructions: Write a program that does the
What is the code in Java? USE STRINGBUILDER...
Sample Output Destination: London Destination: Paris Destination: Rome Destination: done Instructions: Write a program that does the following Create an ArrayList of Strings and call it itinerary Read in destinations from the user until the user enters done (or DONE, 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 route as shown in the output . Use a StringBuilder called sb to create the String travelRoute . tl route: LONDON to PARIS to ROME Loop through all the elements of the ArrayList itinerary -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 travelRouteStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started