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!
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!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 4 images