Welcome in this lecture, I'm going to talk about a challenge for you.
It's about creating a simple user and password protected program, using the power of if statements.
Of course, this program will not be a military level secure program.
It's a simple program just for demonstrating the usage of these statements.
OK, let me show you how it's going to work.
First of all, the user will pass username and password into the program and the program will look into
ways that are strings.
Then it will use an if statement to check whether the user has provided the username and password or
not.
If not so, then the program will display the usage information and will create.
Then it will check the provided username with the correct username, if they don't match, it will display
an error message and you do it again.
If all is OK, then it will check the provided password with the correct password again.
If they don't match, it will display another error message and will quit.
And lastly, and the username and the password, correct, then it will print and access granted the
message.
For now, there should be only one user who can access to this program.
OK, it isn't going to support multiple users yet.
All right.
That's all.
OK, let me show you how it works in the coding, Ed..
I'm going to show its output to you right now.
OK, so you can better understand how it works so you can program it however you want.
OK, when I run it without any arguments, it should display an error message like this one.
Usage, username, password, it asks for username and password.
That's because I didn't give it a username and password.
OK, let's say that we have a user named Jack and his password is eighteen eighty eight.
OK, so when I run it with an incorrect user like this now it should print and access denied error messages
like this are.
Or when I run it with a crack user, but with an incorrect password like this.
Then it should print this invalid password for Jack.
Now, let's run it with the correct username and password.
OK, as you can see now, it's Grant's access to the jack.
All right, that's all this is your challenge.
In the next lecture, I'm going to show you how to build this program.
But before that, please try to do this on your.
All right, good luck, see you.