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!

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter7: Characters, Strings, And The Stringbuilder
Section: Chapter Questions
Problem 19RQ
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
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning