Problem Statement: The purpose of this lab assignment is to gain experience in python's Exception handling. In t assignment, you will write a program for password validation system. Problem Design: Password Validation 1. The program will take password from user and check if it contains the following: a. Password must contain at least one letter b. Password must contain at least one digit c. Length must be between 6 to 12 characters. С.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
icon
Concept explainers
Question

In python create the following:

 

Problem Statement:
The purpose of this lab assignment is to gain experience in python's Exception handling. In this
assignment, you will write a program for password validation system.
Problem Design: Password Validation
1. The program will take password from user and check if it contains the following:
a. Password must contain at least one letter
b. Password must contain at least one digit
c. Length must be between 6 to 12 characters.
d. It may or may not contain any other characters like any special symbols. There is
no restriction on that.
2. Helper functions to check if a password has at least one letter and at least one digit are
provided. Docstring are also given in the template file. These functions return True if
condition satisfies (has at least one digit/letter) otherwise returns False.
3. Your task: Design a base class (Invalid Password) and three child exception classes
(InsufficientLength, NoDigit, NoLetter) to raise the exception when the conditions are not
met.
4. Design a simple user menu to ask for the password as long as the user does not enter a
valid password.
5. The menu should also make a try-except block to call for appropriate Exception class as
needed. If none of the exception occurs the program will print a message as shown in
sample I/O.
6. A sample problem can be found in Exception video lecture use case on designing a
number guessing game. You can follow the same program structure.
Sample I/O:
Enter your password: 123
Password length needs to be between 6 to 12
Enter your password: AAAAAAAA
Password must contain one digit (0-9)
Enter your password: 1234567890
Password must contain one letter
Enter your password: 123aaaAA@
Valid password: 123aaaAA@
Transcribed Image Text:Problem Statement: The purpose of this lab assignment is to gain experience in python's Exception handling. In this assignment, you will write a program for password validation system. Problem Design: Password Validation 1. The program will take password from user and check if it contains the following: a. Password must contain at least one letter b. Password must contain at least one digit c. Length must be between 6 to 12 characters. d. It may or may not contain any other characters like any special symbols. There is no restriction on that. 2. Helper functions to check if a password has at least one letter and at least one digit are provided. Docstring are also given in the template file. These functions return True if condition satisfies (has at least one digit/letter) otherwise returns False. 3. Your task: Design a base class (Invalid Password) and three child exception classes (InsufficientLength, NoDigit, NoLetter) to raise the exception when the conditions are not met. 4. Design a simple user menu to ask for the password as long as the user does not enter a valid password. 5. The menu should also make a try-except block to call for appropriate Exception class as needed. If none of the exception occurs the program will print a message as shown in sample I/O. 6. A sample problem can be found in Exception video lecture use case on designing a number guessing game. You can follow the same program structure. Sample I/O: Enter your password: 123 Password length needs to be between 6 to 12 Enter your password: AAAAAAAA Password must contain one digit (0-9) Enter your password: 1234567890 Password must contain one letter Enter your password: 123aaaAA@ Valid password: 123aaaAA@
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Operators
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education