Question: Design a program which takes a 9 digit string and formats it in Social Security Number Format. ( XXX - XX - XXXX ) Your
Design a program which takes a digit string and formats it in Social Security Number Format. XXXXXXXXX
Your program must take the input as a string or you will receive a on this assignment.
Example:
On the input your program should output something like "Social Security Number:
On the input your program should output something like "Social Security Number:
Edge Cases:
Your program should not accept social security numbers of lengths other that
Your program should not accept social security number which contain nonnumeric characters
Edge Case Examples:
On the input your program should output something like "Length Error: Social Security Numbers must contain numbers"
On the input fycDtkLe" your program should output something like "Character Error: Social Security Numbers must be all numeric."
Do not use an input validation loop;end the program after printing your error message.
Helpful String Methods
length
insert
substr
Consider testing some or all of the values outlined.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
