Question: Read the string variables visitedListName, place 1 , place 2 , and place 3 from input, assuming that the list's name contains multiple words and

Read the string variables visitedListName, place1, place2, and place3 from input, assuming that the list's name contains multiple words and each place visited is a single word. The first input line contains the list's name and the second input line contains the places visited.
Ex: If the input is:
Cities I've visited
Hartford Helena Olympia
then the output is:
Cities I've visited:
Hartford
Helena
Olympia
import java.util.Scanner;
public class PlacesVisited {
public static void main(String[] args){
Scanner scnr = new Scanner(
System.in);
String visitedListName;
string place1;
String place2;
String place 3 ;
System.out.println(visitedListName +";
System.out.println(place1);
System, out.println(place2);
System.out.println(place3);
}
 Read the string variables visitedListName, place1, place2, and place3 from input,

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 Databases Questions!