Question: Write a program named Reverser that reads in a sentence and displays the words of the sentence in reverse order. Use the split method to
Write a program named Reverser that reads in a sentence and displays the words of the sentence in reverse order. Use the split method to extract the words from the sentence. If there is punctuation at the end of the sentence you must remove it and place it at the end of the reversed sentence. The program must keep running until the user enters quit in any case. Use the command prompt window (terminal) for the program.
Sample program run:
Enter a sentence (or quit to exit): I went to school. Reverse sentence: school to went I. Enter a sentence (or quit to exit): Where are you? Reverse sentence: you are Where? Enter a sentence(or quit to exit): Quit Programmed by Your Full Name
5. Create a program SSNValidator.java. Your program must have the following method:
public static boolean isValidSSN(String ssn)
The method will determine if a social security number is valid or not. The method returns true if valid, otherwise false. A valid social security number can contain ONLY nine digits or can contain nine digits AND two hyphens in the format: XXXXXXXXX OR XXX-XX-XXXX Use the Character class in the method to determine if there are digits. Do NOT use regular expressions or you will receive a grade of zero.
The program must keep prompting for a social security number and validating it until the user enters Quit (in any case). You must inform the user if the social security number s/he entered is valid or invalid
NO INPUT OR OUTPUT SHOULD BE DONE ANYWHERE EXCEPT main.
Your full name must appear in the output of both programs or 1 point will be deducted each time it is missing. You must follow the Programming Guidelines handout. All code must be correctly indented and commented. Your programs must compile in order to be graded. Do NOT use Eclipse, NetBeans, or IntelliJ for any labs or assignments. Do NOT create packages or projects; otherwise I will not be able to grade your assignment.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
