Question: Write a program that prompts the user to enter a Social Security number in the format DDD-DD-DDDD, where D is a digit. Your program should

Write a program that prompts the user to enter a Social Security number in the format DDD-DD-DDDD, where D is a digit. Your program should check whether the input is valid. Here are sample runs:

Enter a SSN: 232-23-5435 JEnter 232-23-5435 is a valid social security number Enter a SSN: 23-23-5435 JEnter 23-23-5435 is an invalid social security number

Enter a SSN: 232-23-5435 JEnter 232-23-5435 is a valid social security number Enter a SSN: 23-23-5435 JEnter 23-23-5435 is an invalid social security number

Step by Step Solution

3.45 Rating (158 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Sample Output Sample Run X 1 Enter a SSN 232235435 232235435 is a valid social security number Sampl... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Java Programming Questions!