Set up a password variable in your C# application and assign a password to this variable. Run your program and type in invalid passwords to check and see if your boolean logic is correct. Once the correct password is typed, the program should stop asking for input. You should do this by utilizing a while loop or a do while loop. Sample output is below: Enter the password :: hello INVALID Enter the password :: hacker INVALID Enter the password :: i INVALID Enter the password :: am INVALID Enter the password :: a INVALID Enter the password :: hacker INVALID Enter the password :: taylor INVALID Enter the password :: go INVALID Enter the password :: swift INVALID Enter the password :: taylorswift INVALID Enter the password :: taylorswiftchiefs INVALID Enter the password :: taylorswiftgoingtothesuperbowl VALID
Set up a password variable in your C# application and assign a password to this variable. Run your
Sample output is below:
Enter the password :: hello
INVALID
Enter the password :: hacker
INVALID
Enter the password :: i
INVALID
Enter the password :: am
INVALID
Enter the password :: a
INVALID
Enter the password :: hacker
INVALID
Enter the password :: taylor
INVALID
Enter the password :: go
INVALID
Enter the password :: swift
INVALID
Enter the password :: taylorswift
INVALID
Enter the password :: taylorswiftchiefs
INVALID
Enter the password :: taylorswiftgoingtothesuperbowl
VALID
Step by step
Solved in 3 steps with 1 images