Welcome: <full name>
Enter Password (1…2…3):
Note: You only have 3 attempts to enter the correct password.
IF WRONG PASSWORD: “Password incorrect! Please try again!”
IF CORRECT PASSWORD: “Password accepted!”
string name = "Harlem Shake";
cout << "Welcome: ";
cout << "Enter the TOP SECRET passcode: ";
for (attempts = 0; attempts < 3; attempts++)
if (password == "password") break;
cout << "Password accepted!";
cout << "Password incorrect! Please try again!”;
} // for
} // getPassword
Welcome to C++ Program Examples
Choose an activity:
IF CHOICE IS MORE THAN 15 or 0: “Invalid! Would you like to try again? (Y/N)”
IF ‘N’: Go back to first program.
cout << "Welcome to C++ Program Examples ";
cout << "Choose an activity: ";
cout << "1-15";
for (x = 0; x < 15; x++)
if (choice =< 15) break;
cout << "Invalid! Would you like to try again? (Y/N)”;
} // for
here's my attempt. i badly needed your help guys.
Last edited on
Make an attempt to actually write my homework before i ask in forums.
sorry, will you please help me. :(