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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!