Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Social Security Number Validation ( 1 0 points ) : You will be writing a program that takes in a list of social security numbers

Social Security Number Validation (10 points): You will be writing a program that takes
in a list of social security numbers from the user and after the list has been completely
entered, it validates the answers. Please submit your final Python program and PDF
copy of it via the D2L Dropbox for Assignment 2.
For this program, we will be utilizing many concepts such as lists, Boolean values,
iteration, user input, and formatting in an effort to review early python concepts. A sample
run of the program is shown below, but this program should:
Ask the user to enter social security numbers one at a time until they type some variation
of 'done' (i.e., 'done', 'DONE', 'dOnE', 'doNE', etc... use a string method for this!
The . lower and . upper methods should work nicely).
For every candidate social security number (SSN) entered by the user, the program
should use a function called isvalidSSN () to check the validity of the entered SSN.
This isvalidSSN () function should check the SSN is (1) the valid length, (2) has the
hyphens in the right places, and (3) that all the values other than hyphens are digits. Once these
checks are done, isvalidSSN () should return a 2 element list consisting of the candidate
SSN and a Boolean value describing its validity (e.g.['22a-22-2222', False]).
The program should use the results of calling isvalidSSN () for each candidate
social security number to build a list of lists of all the candidate SSNs and their validity
(e.g.[['111-11-1111', True],['22a-22-2222', False]])). This list of
lists should be printed into a nicely formatted table using f-strings or the format method.
This string formatting should be done in main(). Formatting Strings Help: See
Section 9.2 of your textbook for a refresher on format method and Section 9.11 for f-
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essential SQLAlchemy Mapping Python To Databases

Authors: Myers, Jason Myers

2nd Edition

1491916567, 9781491916568

More Books

Students also viewed these Databases questions

Question

Understand the department managers key role in employee retention

Answered: 1 week ago