Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1. (30 points) Implement a Java application that gets several number of Social Security numbers (SSN) from the user. The number of SSNs to
1. (30 points) Implement a Java application that gets several number of Social Security numbers (SSN) from the user. The number of SSNs to be gathered is specified by using command line argument. Application checks whether the entered SSNs are valid or invalid. An SSN is said to be valid, if it has the format below. a. Use Split method b. Use Regular Expression XXX-XX-XXXX to validate the SSNs. For each option, write a separate application. If the entered SSN is valid, then display it as in the format "xxx xx xxxx", otherwise display an appropriate warning message as in the example run. a. Example Run #1: Enter an SSN: 123-456-789 123 Middle part must contain 2 characters! Example Run#2: Enter an SSN: 1239-12-4567 Initial part must contain 3 characters Example Run #3: Enter an SSN: 867-54-6874 867 54 6874 Enter an SSN: 456-47-654 456 47 Last part must contain 4 characters! Example Run#4: Enter an SSN: 123-45-6789 123 45 6789 Enter an SSN: 345-67-8910 345 67 8910 Enter an SSN: 456-78-9101 456 78 9101
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started