I am takimg an on-line intro to Java course and this weeks assignment has me baffled, can anyone help please? I am to:
1. Request the user to enter a string, such as full name. 2. Once the name is entered, verify that they did enter one. 3. Display a small menu using System.out.println that has the following options: a. 1. Count the number of characters in the string b. 2. Find a substring inside the string c. 3. Display the string in reverse order. d. 4. Exit the program. 4. Once the string is entered, and the menu is displayed, the user is asked to select an option from the list above. Verify that option entered is 1, 2, 3 or 4. If 4, then exit the program using System.exit(0);. Each of the other options will be represented by a method. If an option other than 1 through 4 has been entered, message the user with the error and allow them to start again.
5.If option 1 is selected, call a method that takes the entered string above as a parameter, and returns an integer, which is the number of characters in the string. Once you have the return value, display it using a System.out.println from the option section, not from the method that calculated it. 6.If option 2 is selected, call a method that takes the entered string above as a parameter, and returns an integer which is the starting location of the substring within the longer string. Once you enter this method, you need to prompt the user to enter a substring to search for. Display a message that indicates the substring was found starting at position xx (which is the returned value). 7.If option 3 is selected, call a method that takes the entered string above as a parameter and returns a string that contains the string above in reversed order. Display that reversed string using System.out.println. You?ll need to create an array in this method that stores the characters in the string.
This is my 6th week of this intro course and I desperatly need help!