Python 3  The passwords.csv is as shown below  Validate Passwords in Check File March2021 INVALID iudj8&neB09 Valid MyDogWo0f INVALID mv3m959 INVALID ven1vid1v1c1Iulius INVALID 123456789 INVALID abcdefgcijk INVALID What#ItN0w INVALID windsofchange INVALID HelloMyNameIs INVALID 4584208 INVALID

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Python 3 

The passwords.csv is as shown below 

Validate Passwords in Check File
March2021 INVALID
iudj8&neB09 Valid
MyDogWo0f INVALID
mv3m959 INVALID
ven1vid1v1c1Iulius INVALID
123456789 INVALID
abcdefgcijk INVALID
What#ItN0w INVALID
windsofchange INVALID
HelloMyNameIs INVALID
4584208 INVALID
4586300 INVALID
Anniv&0629 Valid
BDay@1955 INVALID
BigBadW0d! Valid
!Rf0donotcare Valid
R85r!4L145 Valid
S3att!eWa Valid
SONameHere INVALID
Abc!23 INVALID

Format Lines for Report
Use the following format lines to produce correctly formatted output.
Header
print( "\n\n%62s" % "Validate Passwords in Check File\n" )
Detail Line
Valid Passwords
print( "%40s\tValid" % word )
Invalid Passwords
print( "%40s\t\t\tINVALID" % word )
Where “word“ is the name used to address individual entries in the List returned
from buildList.

Process:
1. Ask the user for the name of an input file (a test file is provided).
2. Open the file for input
3. Pass the file to a FUNCTION (buildList) you will define that will:
a. Accept an input file
b. Return a List
c. The function will read the input file, separating individual passwords and storing
the passwords in a List structure.
4. Pass the List created in the previous step to a FUNCTION (buildDictionary) you
will define that will:
a. Accept a List
b. Return a Dictionary
c. Create the Dictionary based on the lengths of the passwords in the List
received. Each entry in the dictionary will consist of a KEY (the password length)
and a VALUE (the count of passwords of that length). See Expected Output for
details.
5. Print a report based on the Dictionary created in step #4.
a. Print report and column headers using provided format lines.
b. Print one line per Dictionary entry, using the provided format line.
c. Expected output for report is included in these instructions.
6. Produce a report indicating the validity or invalidity of each password:
a. Print a report header line using the provided format line.
b. Print individual detail lines for the report by:
Passing each individual string to a FUNCTION (validatePassword) you
will define that will:
1. Accept a string value
2. Return a boolean value
3. Determine whether the received string is a valid password based
on the following rules:
a. The string must be AT LEAST 8 characters long
b. The string must contain AT LEAST 1 UPPER CASE letter
c. The string must contain AT LEAST 1 LOWER CASE letter
d. The string must contain AT LEAST 1 instance of one of the
following SPECIAL CHARACTERS: $, !, &, *.
4. Return True if the string passes all tests. Return False if the string
fails at least one test.
• Write an output line based on the return value form the previous step,
using the provided format lines.
Transcribed Image Text:Process: 1. Ask the user for the name of an input file (a test file is provided). 2. Open the file for input 3. Pass the file to a FUNCTION (buildList) you will define that will: a. Accept an input file b. Return a List c. The function will read the input file, separating individual passwords and storing the passwords in a List structure. 4. Pass the List created in the previous step to a FUNCTION (buildDictionary) you will define that will: a. Accept a List b. Return a Dictionary c. Create the Dictionary based on the lengths of the passwords in the List received. Each entry in the dictionary will consist of a KEY (the password length) and a VALUE (the count of passwords of that length). See Expected Output for details. 5. Print a report based on the Dictionary created in step #4. a. Print report and column headers using provided format lines. b. Print one line per Dictionary entry, using the provided format line. c. Expected output for report is included in these instructions. 6. Produce a report indicating the validity or invalidity of each password: a. Print a report header line using the provided format line. b. Print individual detail lines for the report by: Passing each individual string to a FUNCTION (validatePassword) you will define that will: 1. Accept a string value 2. Return a boolean value 3. Determine whether the received string is a valid password based on the following rules: a. The string must be AT LEAST 8 characters long b. The string must contain AT LEAST 1 UPPER CASE letter c. The string must contain AT LEAST 1 LOWER CASE letter d. The string must contain AT LEAST 1 instance of one of the following SPECIAL CHARACTERS: $, !, &, *. 4. Return True if the string passes all tests. Return False if the string fails at least one test. • Write an output line based on the return value form the previous step, using the provided format lines.
Expected Output
Password Length Report
Using the provided passwords.csv file, your report should look like the one below. Your entries
may be in a different order.
Password Length Dictionary Entries
Length
Count
5
11
2
3
18
1
10
5
13
1
Format Lines for Report
Use the following format lines to produce correctly formatted output.
Headers
print( "\n\nPassword Length Dictionary Entries")
print( "%9s%20s" % ( "Length", "Count" ) )
Detail Line
print( "%6d %20ed" % (key, lengthDict[ key ]))
Where “key" is the variable name used in the iteration control (see "Traversing a
Dictionary" in Module 05) and lengthDict is the name assigned to the Dictionary
returned from buildDictionary.
Transcribed Image Text:Expected Output Password Length Report Using the provided passwords.csv file, your report should look like the one below. Your entries may be in a different order. Password Length Dictionary Entries Length Count 5 11 2 3 18 1 10 5 13 1 Format Lines for Report Use the following format lines to produce correctly formatted output. Headers print( "\n\nPassword Length Dictionary Entries") print( "%9s%20s" % ( "Length", "Count" ) ) Detail Line print( "%6d %20ed" % (key, lengthDict[ key ])) Where “key" is the variable name used in the iteration control (see "Traversing a Dictionary" in Module 05) and lengthDict is the name assigned to the Dictionary returned from buildDictionary.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY