(1) Ask the user to type in a sentence or phrase with between 2 and 5 words (2 really would be fine).
(2) Display the userís sentence or phrase.
(3) Reverse the wording by word.
(4) Reverse the entire sentence by characters.
(5) Find a substring in the sentence or phrase and display it. (It need not be an actual word)
(6) Display only the first word of the userís sentence or phrase all in upper case letters.
(7) Display the length of the original sentence or phrase.
System.out.print("Hello user, please enter a sentence or phrase which is two words:");
String s1, s2;
s1 = keyboard.next();
System.out.println("You entered\"" + s1 + "\" and \"" + s2 + "\"");
So I got the program to separate the two strings. I am on step 3 now and I am wondering if i need to equal both the strings in order to continue. I tried up there but i dont think it is right. For example if the user puts : " Hello World" it would be "World Hello." I need help. I know how to reverse the letters of each string but how can i do that to both words. I tried this but it did not work for s2 only s1 which it said olleH:
Please help. I have until wednesday! Thank you!