You will get email Reply within few hours

Friday 31 May 2013

Recursive Reverse String



Do Programming Exercise #7 on page 898 of the textbook. Create a main program that prompts the user for a string of characters. When the user has entered the character string, it will print the string, call the “reverseString” method, and print the reversed string. Your “reverseString” method should be a recursive method that returns a String object and requires a String reference as a parameter. The “reverseString” method will return the same characters that were passed to the method, but only in reverse order.
The “reverseString” method should perform the following steps:
If the incoming string has a length less than or equal to 1, return the incoming string.
Else, remove the first character from the incoming string.
Call “reverseString” and pass this shortened string to it.
Concatenate the reversed shortened string with the first character that was removed.
Return the concatenated string.

Export your project as a zip file and upload it to Blackboard. Below is a sample of how your program might look:
Enter a string to be reversed: Able was I ere I saw Elba
Your input string is:
Able was I ere I saw Elba
Your input string reversed is:
ablE was I ere I saw elbA


Excercise #7 - page 898
Write a program that uses a reversive method to print a string backward. Use appropriate parameters in your method.


Need Solution https://gum.co/YIGe