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, place place and place 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 mainString args
Scanner scnr new Scanner
System.in;
String visitedListName;
string place;
String place;
String place ;
System.out.printlnvisitedListName ;
System.out.printlnplace;
System, out.printlnplace;
System.out.printlnplace;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
