Write a program that prompts the user to enter a Social Security number in the format DDD-DD-DDDD,

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 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

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: