Prompt for the user to enter their name.  Print out their name forwards, backwards, vertically-forwards and vertically-backwards.   You will need to declare a String variable, use Scanner to get input of a String, call a String method to isolate one letter and create a loop that traverses the name forwards and backwards.   Sample Output:   Enter your name: Florene   Florene enerolF F l o r e n e e n e r o l  F   HINTS: Scanner input = new Scanner(System.in); String myName = input.nextLine();  // input is a Scanner object int len = myName.length()          // len is the number of characters System.out.println (myName.substring(len-1, len)); // prints last letter   I need help with coding the name "Pooja" vertically-forwards and vertically-backwards in java. If you could show me what codes to type in, that would be great. Thank you!

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter5: Looping
Section: Chapter Questions
Problem 15E
icon
Related questions
Question

Prompt for the user to enter their name. 

Print out their name forwards, backwards, vertically-forwards and vertically-backwards.

 

You will need to declare a String variable, use Scanner to get input of a String, call a String method to isolate one letter and create a loop that traverses the name forwards and backwards.

 

Sample Output:

 

Enter your name:

Florene

 

Florene

enerolF

F

l

o

r

e

n

e

e

n

e

r

o

F

 

HINTS:

Scanner input = new Scanner(System.in);

String myName = input.nextLine();  // input is a Scanner object

int len = myName.length()          // len is the number of characters

System.out.println (myName.substring(len-1, len)); // prints last letter

 

I need help with coding the name "Pooja" vertically-forwards and vertically-backwards in java. If you could show me what codes to type in, that would be great. Thank you!

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,