char day[10]; char name[12]; char shower; char shirt; cout<< "Welcome to the Interactive Choose Your Own Adventure!" <<endl; cout<< "Remember, nice guys don't always finish last!" <<endl; cout<< "Just most of the time......."<<endl; cout<< "For all questions, enter Y for Yes, and N for No! It's easy!!\n"; cout<<endl<< "Here we go!!"<<endl<<endl; system("PAUSE"); cout<<"Before we get started, what's your first name? "; cin >> name; cout<<endl<<"What's today? I think it's either Sunday or Monday..."; cin >> day; cout<<"Good. I think we can get started. You sure you're ready? "; cout<<endl; system("PAUSE"); cout<<endl; cout<<"It's "<< day << " morning. Do you want to take a shower before you "; cout<<"embrace the day?: "; cin >> shower; if (shower == 'Y' || shower == 'y') { cout<< "\nYour name must not be Bradley. Thank goodness you're clean!\n\n"; } else if (shower == 'N' || shower == 'n') { cout<< "Wow that's awful. Do you know this guy named Bradley?\n"; cout<< "He never showered at all. Now he doesn't have any friends\n\n"; } cout<<"Now that you're out of bed, it's time to get dressed. What do you "; cout<<"want to wear with your jeans, a (P)olo, (T)ee, or (B)eater?:\n "; cout<<"***If you aren't smart enough to figure it out, enter the letter that"; cout<<" is enclosed in the () for your choice***\n"; cout<<"Wait, what was it you wanted to wear again?: "<<endl; cin >>shirt; |
void InvokeChoice1(); void InvokeChoice2(); int main(int,char *[]) { // lots of stuff before this int nValue = 0; cout << "What would you like to do? 1) Fight the monster 2) Run away..." << std::endl; cin >> nValue; if (nValue == 1) { InvokeChoice1(); } else if (nValue == 2) { InvokeChoice2(); } |