The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 398 Weeks Ago, 1 Day Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
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. 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
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 travelRoute.
Sample Output:
Destination: London
Destination: Paris
Destination: Rome
Destination: done
travel route:
LONDON to PARIS to ROME
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll