someone help me with my case study to be submitted thos week

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!”


int getPassword()

string name = "Harlem Shake";
int attempts;
string password;

cout << "Welcome: ";
getline(cin, name);

cout << "Enter the TOP SECRET passcode: ";
getline(cin, password);

for (attempts = 0; attempts < 3; attempts++)

if (password == "password") break;
cout << "Password accepted!";

cout << "Password incorrect! Please try again!”;

} // for
return attempts;
} // 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.


int activity()
int choice;
int x;

cout << "Welcome to C++ Program Examples ";
cout << "Choose an activity: ";
cout << "1-15";
getline(cin, choice);

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. :(
Topic archived. No new replies allowed.