Question
In netbeans/java: You are writing a driver class program that reverses a String/sentence entered by the user. You must write the code in its entirety
In netbeans/java:
You are writing a driver class program that reverses a String/sentence entered by the user. You must write the code in its entirety and cannot use any existing methods that perform the reversing operation.
The program is to print out both the entered sentence and the reversed sentence with headers.
The program should allow the user to continue entering sentences until s/he decides to quit. You are to use a DO-WHILE loop to manage this functionality.
When the program ends, print a thank you message to the user.
NOTE: Using the nextLine() method can cause problems. After using the next() method to prompt the user to continue, make a call to the nextLine() method to get your cursor realigned. This will be demonstrated in class.
You need to include clear comments throughout the program that explain what functionality the various lines/small sections of code/methods are as related to the execution of the program.
Sample output from the program
The following program reads in a sentence from the user and prints it out in reverse. Please type a sentence then press enter: ISCS140 is my favorite class! Your original sentence: ISCS140 is my favorite class! The sentence reversed: !ssalc etirovaf ym si 041SCSI Would you like to reverse another sentence? (y/n): y Please type a sentence then press enter: I can't believe it's November already! Your original sentence: I can't believe it's November already! The sentence reversed: !ydaerla rebmevoN s'ti eveileb t'nac I Would you like to reverse another sentence? (y/n): n Thanks for using Reverse.
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