You are on page 1of 1

Performance Task 1 (20pts)

Create a table named tbl_users (if you have an existing one, delete it) with the following columns

uid username password a_name age gender


 uid field must start with 1001 and is auto increment (by 1)
 uid shall be set to primary key
 username and password size is 32
 a_name size is 50
 gender size is 1

Insert the following records

username password a_name age gender


root admin321 super user 99 m
guest random321 guest user 30 f

Performance Task2 (30pts)

Create a Login Program that’s record dependent on the database. The program should get the user’s
input user name and password and compare it to the database.

Example 1: Logging in with super user account.

Enter your username: root


Enter your password: admin321
Login Success! Welcome super user!
You are granted with admin access!
Build Successful.

Example 2: Logging in with guest user.

Enter your username: guest


Enter your password: random321
Login Success! Welcome guest user!
Build Successful.

Example 3: An attempt to login with super user but wrong password.

Enter your username: root


Enter your password: admin123
Login Failed!
Build Successful.

Example 4: An attempt to login without any account.

Enter your username: asdf


Enter your password: asdf
Login Failed!
Build Successful.

You might also like