Question: Write a program that prompts the user for a name and prints each letter of the name on separate lines. For example, inputting Bob Smith

Write a program that prompts the user for a name and prints each letter of the name on separate lines. For example, inputting "Bob Smith" would produce the following output

Please enter your name: Bob Smith

B o b S m i t h 

The methods available from the String class are charAt() and length(). Also, the Scanner class will be needed (import java.util.* and construct a new object using "new"). You will need the nextLine() method for user input. It is ok to put all of the program in the main method for this question.

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!