Answered step by step
Verified Expert Solution
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
Topics: Pseudocode, Branching, For and While Loops, Sequences, Basic IO
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
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 GraB 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 'JaneDoeGraB This string will then be appended to the global 'database' list.
Four lists, 'uppercaseletters' list of all letters in upper case
'lowercaseletters' list of all letters in lower case
'digits' list of all digits
'database' list of 'usernamepassword' 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 lowercase 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.
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 'usernamepassword' string explicitly and print them separately. Please do not print the whole sequence type asis
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 'usernamepassword' string from the 'database' list. Display an informational message once updated.
Exitterminate 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 in Module : simpleauthenticaltionsystem.py and extendedsimpleauthenticationsystem.py
Menu program: while loop use case: simple calculator application in Module
Generic string and list operations: Video Lecture and in Module 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 : Think about updating an item by index.
Sample IO: Sample IO is provided for your clear understanding. You need to use the format function to properly display the information. Please note that the sample IO is only provided to clarify what is expected from the program. You need to test your code on the given IO You may change the languageinterface but the program needs to display the information as shown:
Example :
Welcome to Password Storage and Management system
Available options:
: Add password
: Display usernames and passwords
: Update password by username
: Exit
Enter option:
Add username and password to the database
Enter your username:janeDoe
Enter your password Example: ABcd : MsoN
Password Accepted!
Adding username and password janeDoeMsoN to the database
Welcome to Password Storage and Management system
Available options:
: Add password
: Display usernames and passwords
: Update password by username
: Exit
Enter option:
Add username and password to the database
Enter your username:Mary
Username Mary already in database! Choose to update.
Welcome to Password Storage and Management system
Available optin
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started