Alice wants to build a replica of a user database with CSV files. The pro- gram should be able to take input and allow users to log in/log out/register. Help Alice to implement a user database with CSV files. Design We need to understand how to set up a step-by-step process for logging users in and out. There are three main parts to this program, registering a user, logging a user in, and the main loop that will run the program. Knowing that the first two are tasks, we can make functions out of them and call them when necessary in the main loop. Let's go ahead and lay out the logical process for this program: 1. Check to see if user is logged in. (a) If logged in, ask if they would like to change password/log out/quit. i. If change password, ask for current password. • If correct, ask for new password/confirm password. If passwords match, save user and restart. Else, display error and restart. ii. Either quit or log out user and restart. (b) Else, ask if they would like to log in/register/quit. i. If log in, ask user for e-mail/password. • If correct, log user in and restart. 1
Else, display error and restart. ii. If register, ask for e-mail/password/password2. • If passwords match, save user and restart. . Else, display error and restart. iii. If quit, say thank you and exit program. The password must have the following strength criteria. 8 characters length. • The first 2 characters are letters in Upper Case. • The following character is a Special Character (!#$&*). . The following two characters are numerals. . The last three characters are letter in Lower Case.
Sample Run 1. Login 2. Register 3. Quit What would yoou like to do? register To register, please enter your info: E-mail: [email protected] Password: 123 Re-type password: 123 Yor password do not follow the strength criteria 1. Login 2. Register 3. Quit What would yoou like to do? register To register, please enter your info: E-mail: [email protected] Password: AB@13abc Re-type password: ABC13abc You are now registered! 1. Login 2. Register 3. Quit What would yoou like to do? login To login, please enter your info: E-mail: [email protected] Password: ABC13abc You are now logged in! 1. Change Password (change) 2. Logout 3. Quit What would yoou like to do? change To change password, please enter your current password: Password: ABC13abc To change password, please enter your info: 3
Password: AB@14abc Re-type password: AB014abc 1. Login 2. Register 3. Quit What would yoou like to do? login To login, please enter your info: E-mail: [email protected] Password: AB@14abc You are now logged in! 1. Change Password (change) 2. Logout 3. Quit What would yoou like to do? quit Thanks for using our software!
Alice wants to build a replica of a user database with CSV files. The pro- gram should be able to take input and allow u
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Alice wants to build a replica of a user database with CSV files. The pro- gram should be able to take input and allow u
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!