Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started