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

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter11: Exception Handling
Section: Chapter Questions
Problem 2E
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT