3.a

3.a.1

The program is coded so that the user can create an account on the site and log in. In addition, we made it possible for users to delete their accounts so that they can retrieve their passwords if they are lost.

3.a.2

In the video, it shows user inputting new username and password to make a new account. When you log in, enter the correct username and password, and go to the main page. If incorrect, the login page tells you that the username or password is incorrect.

3.a.3

The video will show user inputting own username, password, and birthday for making account. If account is finally created, the user will go to login page for the login. The video will show that if user enters correct username and password, he will go to main website. If there is an error during login, the warning will come out. Besides, in order to change password, user has to input the right birthday and username.

3.b

3.b.1

list

3.b.2

signup

3.b.3

data

3.b.4

This variable data is made into a database for users. Extract the data from the API and store it in the code as a variable called data. In this data, user names and passwords of various people and various information are grouped and divided for each user.

3.b.5

If the program were to run without the “data” dictionaries, it would be hard to verify username and password. In order to know whether the user inputs are right or wrong, all user information are required. The data is to find the match value with the user’s inputs in the dictionaries. Therefore, program can run for login system.

3.c

3.c.1

para

3.c.2

user

3.c.3

Entering the birthday information is essential to change the password, but this is very different from the birthday entered in JavaScript and the value shown in the api. So, we need a function to forcibly change the format. So, based on what is written in this function -, it is divided into three parts: year, month, and day. And as a final result, the birthday is completed in the order of month, day, and year.

3.c.4

When getting information from the API, the code is sequential and it needs to check that the user and password entered by the user match the information in the dictionary to ensure that there is a valid password. The process is an iterative process and can be repeated continuously using a while loop. The loop will stop if all information has been checked or if suitable information is found. There are several conditional statements in the code I created, and there is a condition for when the information entered by the user is in the dictionary or when checking of all the information in the dictionary is finished.

3.d

3.d.1

First call: user inputs the his own username and password

Seconde call: user inputs the wrong username or password

3.d.2

Conditions for first call: if (data[i][“username”] === username && data[i][“password”]===password)

Conditions for Second call: if (i >= data.length)

3.d.3

Results of the first call: The result of the first call is that username and password are correct, so user will be sent to main website

Result of the second call: The result of the second call is alert that username or password are wrong.

Link

Code for login

Link

Code for Deleting account

Link

Code for changing password

Link