
The If Else Statement will see if the statements are true: if they are it will print out the correct message, and if they are false it will print the last message. However, we have made a new string variable called “message” this was made to avoid repeating the console message. The process is the same as before, but we have more decisions. If username = "Admin" And password = 2012 ThenĬonsole.WriteLine("Oops could not find you!") If username = "Dave" And password = 12345 Then You can also have a nested If Else Statement. You are also using the logical operator And which will be explained later. So if username = “Asim” AND password = 243, then “Welcome Asim” is displayed otherwise “Access Denied” is displayed. Then we compare those values to the values in our If Statement. You have two variables (string/integer) which we use to store the values the user enters when prompted.

This is similar to the above If Statement. If username = "Asim" And password = 243 Then Comment out the other If Statement ( CTRL+K+C) and copy the following code: Dim username As String
