1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
|
// Hmwrk02
// This program outputs a Mad Lib using variables input by computer.
#include <iostream>
#include <string>
using namespace std;
int main (void)
{
//// 1.0 Main ////
//// 1.1 User Instructions ////
cout << "Enter words as prompted" << endl;
cout << "If more than one word is needed, sepereate using space" << endl;
cout << endl;
cin.ignore(999,'\n');
//// 1.2 Prompt User ////
//// 1.2.1 Verbs ////
string verb1, verb2;
cout << "Enter TWO verbs: ";
cin >> verb1;
cin >> verb2;
//// 1.2.2 Nouns ////
string noun1, noun2, noun3, noun4, noun5, noun6;
cout << "Enter SIX nouns: ";
cin >> noun1;
cin >> noun2;
cin >> noun3;
cin >> noun4;
cin >> noun5;
cin >> noun6;
//// 1.2.3 Animal ////
string animal;
cout << "Enter ONE animal: ";
cin>> animal;
//// 1.2.4 Careers ////
string career1, career2, career3, career4;
cout << "Enter FOUR careers: ";
cin >> career1;
cin >> career2;
cin >> career3;
cin >> career4;
//// 1.2.5 Adjective ////
string adjective;
cout << "Enter ONE adjective: ";
cin >> adjective;
//// 1.3 Mad Lib ////
cout << "We don't " << verb1 << "and" << verb2 << noun1 << "because it's cute." << endl;
cout << "We " << verb1 << "and" << verb2 << noun1 << "beacuse we are members of the " << animal << "race." << endl;
cout << " And the " << animal << "race is filled with " << noun2 << "." << endl;
cout << "And " << career1 << "," << career2 << "," << career3 << "," << career4 << ","
<<"These are " << adjective << "pursuits and necessary to sustain " << noun3 << "." << endl;
cout << "But " << noun1 << ", " << noun4 << "," << noun5 << "," << noun6 << ", these are what we stay alive for." << endl;
//// 3.0 Endgame ///
//// 3.1 Pause Screen ///
cout << endl;
cout << "Press ENTER to continue..." << endl;
cin.ignore(999, '\n');
//// 3.2 Terminate Program ////
return 0;
}
|