Question: / / Program asks user to enter password / / If password is not home, lady or mouse / / the user must re -

// Program asks user to enter password
// If password is not "home", "lady" or "mouse"
// the user must re-enter the password
using static System.Console;
class DebugFive1
{
static void Main()
{
const string PASS1= "home";
const string PASS2= "lady";
const string PASS3= "mouse";
string password;
WriteLine("Please enter your password: ");
password = ReadLine();
while (password != PASS1 && password != PASS2 && password != PASS3)
{
WriteLine("Invalid password. Please enter again: ");
password = ReadLine();
}
WriteLine("Valid password");
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!