Question: Write a program that asks the user for a sentence, and then returns that string with the words backwards. For example: Enter a sentence! Mary
Write a program that asks the user for a sentence, and then returns that string with the words backwards. For example: Enter a sentence! Mary had a little lamb. Your sentence backwards: lamb. little a had Mary Write a method called reverse() that accepts a sentence as a string, and then returns that string with the words backwards. Write a main() method that gets the string from the user and then displays the string backwards. demonstrate program by writing comments comments
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
