subject

In this assignment, you will implement an online banking system. Users can sign-up with the system, log in to the system, change their password, and delete their account. They can also update their bank account balance and transfer money to another user’s bank account. You’ll implement functions related to File I/O and dictionaries. The first two functions require you to import files and create dictionaries. User information will be imported from the "users. txt" file and account information will be imported from the "bank. txt" file. Take a look at the content in the different files. The remaining functions require you to use or modify the two dictionaries created from the files.
Each function has been defined for you, but without the code. See the docstring in each function for instructions on what the function is supposed to do and how to write the code. It should be clear enough. In some cases, we have provided hints to help you get started.
def signup(user_accounts, log_in, username, password):
'''This function allows users to sign up.
If both username and password meet the requirements, updates the username and the corresponding password in the user_accounts,
and returns True.
If the username and password fail to meet any one of the following requirements, returns False.
- The username already exists in the user_accounts.
- The password must be at least 8 characters.
- The password must contain at least one lowercase character.
- The password must contain at least one uppercase character.
- The password must contain at least one number.
- The username & password cannot be the same.
For example:
- Calling signup(user_accounts, log_in, "Brandon", "123abcABCD") will return False
- Calling signup(user_accounts, log_in, "BrandonK", "123ABCD") will return False
- Calling signup(user_accounts, log_in, "BrandonK","abcdABCD") will return False
- Calling signup(user_accounts, log_in, "BrandonK", "123aABCD") will return True. Then calling
signup(user_accounts, log_in, "BrandonK", "123aABCD") again will return False.
Hint: Think about defining and using a separate valid(password) function that checks the validity of a given password.
This will also come in handy when writing the change_password() function.
'''
# your code here
def import_and_create_accounts(filename ):
'''
This function is used to create an user accounts dictionary and another login dictionary. The given argument is the filename to load.
Every line in the file will look like
username - password
If the username and password fulfills the requirement, add the username and password into the user accounts dictionary.
To make sure that the password fulfills these requirements, be sure to use the signup function that you wrote above.
For the login dictionary, the key is the username, and its value indicates whether the user is logged in, or not.
Initially, all users are not logged in.
Finally, return the dictionaries.
Note: All of the users in the bank file are in the user account file.
def login(user_accounts, log_in, username, password):
'''
This function allows users to log in with their username and password.
The users_accounts stores the usernames and passwords.
If the username does not exist or the password is incorrect, return False.
Otherwise, return True.
For example:
- Calling login(user_accounts, "Brandon", "123abcAB") will return False
- Calling login(user_accounts, "Brandon", "brandon123ABC") will return True
Note: If a user is already logged in, this should return False - a user cannot log
in a second time once logged in

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 15:00
The three logical operators used to write compound conditions are "and," "or," and "not." a: true b: false
Answers: 2
question
Computers and Technology, 23.06.2019 03:50
Q-1 which of the following can exist as cloud-based it resources? a. physical serverb. virtual serverc. software programd. network device
Answers: 1
question
Computers and Technology, 23.06.2019 19:00
Write a program that displays the following menu: geometry calculator 1. calculate the area of a circle 2. calculate the area of a rectangle 3. calculate the area of a triangle 4. quit enter your choice (1-4): if the user enters 1, the program should ask for the radius of the circle and then display its area. use the following formula: area = ď€(the square of r) use 3.14159 for ď€ and the radius of the circle for r. if the user enters 2, the program should ask for the length and width of the rectangle and then display the rectangle’s area. use the following formula: area = length * width if the user enters 3, the program should ask for the length of the triangle’s base and its height, and then display its area. use the following formula: area = base * height * .5 if the user enters 4, the program should end. input validation: display an error message if the user enters a number outside the range of 1 through 4 when selecting an item from the menu. do not accept negative values for the circle’s radius, the rectangle’s length or width, or the triangle’s base or height. note: if the user enters an improper menu choice (1-4), the program prints "the valid choices are 1 through 4. run the program again and select one of those." if the user enters a negative radius, the program prints "the radius can not be less than zero." if the user enters a negative value for height or base, the program prints "only enter positive values for base and height."
Answers: 1
question
Computers and Technology, 23.06.2019 23:00
Lucas put a lot of thought into the design for his company's new white paper. he made sure to include repeating design elements such as color schemes and decorative images. his goal was to a.add symmetry b.create a unified publication c.provide consistency d.save money
Answers: 1
You know the right answer?
In this assignment, you will implement an online banking system. Users can sign-up with the system,...
Questions
question
Mathematics, 21.05.2020 23:09
question
History, 21.05.2020 23:09
Questions on the website: 13722367