WEBVTT 00:00.890 --> 00:04.130 Welcome in this lecture, I'm going to talk about a challenge for you. 00:05.090 --> 00:11.030 It's about creating a simple user and password protected program, using the power of if statements. 00:12.130 --> 00:15.680 Of course, this program will not be a military level secure program. 00:16.360 --> 00:20.140 It's a simple program just for demonstrating the usage of these statements. 00:20.200 --> 00:22.720 OK, let me show you how it's going to work. 00:23.380 --> 00:29.830 First of all, the user will pass username and password into the program and the program will look into 00:29.830 --> 00:31.170 ways that are strings. 00:32.320 --> 00:37.810 Then it will use an if statement to check whether the user has provided the username and password or 00:37.810 --> 00:38.110 not. 00:38.410 --> 00:42.700 If not so, then the program will display the usage information and will create. 00:43.770 --> 00:50.190 Then it will check the provided username with the correct username, if they don't match, it will display 00:50.190 --> 00:52.080 an error message and you do it again. 00:52.770 --> 00:57.960 If all is OK, then it will check the provided password with the correct password again. 00:57.960 --> 01:01.530 If they don't match, it will display another error message and will quit. 01:02.520 --> 01:07.800 And lastly, and the username and the password, correct, then it will print and access granted the 01:07.800 --> 01:08.190 message. 01:09.160 --> 01:12.760 For now, there should be only one user who can access to this program. 01:12.950 --> 01:15.970 OK, it isn't going to support multiple users yet. 01:16.630 --> 01:17.240 All right. 01:17.260 --> 01:17.800 That's all. 01:18.460 --> 01:21.250 OK, let me show you how it works in the coding, Ed.. 01:21.730 --> 01:23.860 I'm going to show its output to you right now. 01:24.060 --> 01:28.570 OK, so you can better understand how it works so you can program it however you want. 01:29.290 --> 01:34.480 OK, when I run it without any arguments, it should display an error message like this one. 01:35.810 --> 01:40.050 Usage, username, password, it asks for username and password. 01:40.760 --> 01:44.420 That's because I didn't give it a username and password. 01:44.960 --> 01:50.300 OK, let's say that we have a user named Jack and his password is eighteen eighty eight. 01:50.640 --> 01:58.190 OK, so when I run it with an incorrect user like this now it should print and access denied error messages 01:58.190 --> 01:58.660 like this are. 01:59.640 --> 02:04.530 Or when I run it with a crack user, but with an incorrect password like this. 02:07.350 --> 02:10.500 Then it should print this invalid password for Jack. 02:11.300 --> 02:14.210 Now, let's run it with the correct username and password. 02:16.700 --> 02:19.880 OK, as you can see now, it's Grant's access to the jack. 02:20.910 --> 02:23.160 All right, that's all this is your challenge. 02:23.520 --> 02:26.700 In the next lecture, I'm going to show you how to build this program. 02:27.210 --> 02:29.960 But before that, please try to do this on your. 02:31.070 --> 02:33.320 All right, good luck, see you.