You will need to think about problem solving. There are several multi-step activities.
Design, compile and run a single Java program, StringEx.java, to accomplish all of the following tasks. Add one part at a time and test before trying the next one. The program can just include a main method, or it is neater to split things into separate methods (all static void, with names like showLength, sentenceType, lastFirst1, lastFirst), and have main call all the ones you have written so far (or for testing purposes, just the one you are working on, with the other function calls commented out). Use the UI class for user input. You can copy the file into your project.
Read a string from the keyboard and print the length of the string, with a label.
Read a sentence (string) from a line of input, and print whether it represents a declarative sentence (i.e. ending in a period), interrogatory sentence (ending in a question mark), or an exclamation (ending in exclamation point) or is not a sentence (anything else).
It makes sense to only make small changes at once and build up to final code. First you might just code it to check if a sentence is declarative or not. Then remember you can test further cases with else if (...).
Read a whole name from a single line of user input. Do not ask for first and last names to be entered on separate lines! Assume first and last names are separated by a space (no middle name). Print last name first followed by a comma and a space, followed by the first name. For example, if the input is "Marcel Proust", the output is "Proust, Marcel".
Improve the previous part, so it also allows a single name without spaces, like "Socrates", and prints the original without change. If there are two parts of the name, it should work as in the original version.
Run the program (with parts 1, 2 and 4 active) and show your TA when you are done. You should run it twice to show off both paths through part 4. Alternately have the main program just call part 4 twice!