Problem:
my output is the following:
Enter the type of Person: S
Enter in a name: John Down
Enter the type of Person: Enter the type of Person:
The output I would like to see is....
Enter the type of Person: S
Enter in a name: John Down
Enter the type of Person:
I'm trying to figure out how to use a switch statement inside of the for loop. I'm trying to figure out how to force the loop to stop so it will allow me to answer the prompt, "Enter the type of Person:"
Any suggestions?
for(int i=0; i<4; i++) { System.out.print("Enter the type of Person: "); userInput = keyboard.next().charAt(0); switch(userInput) { case 'P': String name; System.out.print("Enter in a name: "); name = keyboard.next(); people[1].setName(name); break; case 'S':