Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Homework Assignment - 2 Topics: Pseudocode, Branching, For and While Loops, Sequences, Basic I / O Problem description: Write a Python application to simulate a

Homework Assignment -2
Topics: Pseudocode, Branching, For and While Loops, Sequences, Basic I/O
Problem description:
Write a Python application to simulate a Password Storage and Management system. The purpose of this assignment is to gain experience in Python's loop (while and for) structure, conditional structure, sequences, and basic IO.
Design solution:
The program initially provides a menu to the user. The user can choose an operation by entering the number associated with that option as input. The three operations of the menu are explained below.
Add username and password to the database: The program asks the user to input a username and password. There are no specifications for the username. However, the password must consist of six characters: two upper case letters, two lower case letters, and two digits, in any order. The password should not contain any other characters (special symbols, etc.) at all. An example username can be 'JaneDoe' and a password can be 'Gr81aB'. The program will go on to check whether the password meets these requirements or not. If successful, the program joins the username and password by a '-'. An example would look like 'JaneDoe-Gr81aB'. This string will then be appended to the global 'database' list.
Four lists, 'upper_case_letters' - list of all letters in upper case
'lower_case_letters' - list of all letters in lower case
'digits' - list of all digits
'database' - list of 'username-password' strings
will be provided to you in the template. You can use these lists accordingly. If not successful, print the error message providing the reason along with the number of upper- and lower-case letters and digits in the password entered by the user.
Please note: All the usernames in the 'database' list must be unique. So, when the user provides the username as input, please check that they are not giving a username already in the database list.
2. Displaying the list of passwords and usernames: On selecting this option, the program outputs all the usernames and passwords present in the database at that time. You will have to split the username and password from the 'username-password' string explicitly and print them separately. Please do not print the whole sequence type as-is.
3. Update the password of an existing user: The program asks the user to input the username for which the password is to be updated from the 'database' list. It then finds the particular 'usernamepassword' string associated with the input username and updates the 'username-password' string from the 'database' list. Display an informational message once updated.
4. Exit/terminate the program.
If the user enters any other option, display a message stating that the option is invalid and a request to try again.
Notes:
You need to write pseudocode to plan the program, and it needs to be submitted inside the template file in the Pseudocode section of the header.
Helpful Code and Hints:
For password checking, while loop video lecture 3.5 in Module 3: simple_authenticaltion_system.py and extended_simple_authentication_system.py
Menu program: 3.6 while loop use case: simple calculator application in Module 3
Generic string and list operations: Video Lecture 4.3 and 4.5 in Module 4. Hint: How can you split a string by a delimiter?
Accessing a list database: Review how to access each item in a list using a for loop
How to update a particular item in a list (needed for option 3): Think about updating an item by index.
Sample I/O: Sample I/O is provided for your clear understanding. You need to use the format function to properly display the information. Please note that the sample I/O is only provided to clarify what is expected from the program. You need to test your code on the given I/O. You may change the language/interface but the program needs to display the information as shown:
Example 1:
********* Welcome to Password Storage and Management system *********
Available options:
1: Add password
2: Display usernames and passwords
3: Update password by username
4: Exit
Enter option: 1
********* Add username and password to the database *********
Enter your username:janeDoe
Enter your password (Example: ABcd56) : M8soN1
Password Accepted!
Adding username and password janeDoe-M8soN1 to the database
******** Welcome to Password Storage and Management system ********
Available options:
1: Add password
2: Display usernames and passwords
3: Update password by username
4: Exit
Enter option: 1
***** Add username and password to the database ***
Enter your username:Mary
Username Mary already in database! Choose 3 to update.
********* Welcome to Password Storage and Management system *********
Available optin
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

Students also viewed these Databases questions

Question

The company openly shares plans and information with employees.

Answered: 1 week ago