Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Programming Languages 12th International Symposium Dbpl 2009 Lyon France August 2009 Proceedings Lncs 5708

Authors: Philippa Gardner ,Floris Geerts

2009th Edition

3642037925, 978-3642037924

More Books

Students also viewed these Databases questions