Advertisement
axyd

CS172 l2ex24

Feb 18th, 2016
304
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.20 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int intex24(){
  6.         string name, age, city, college, prof, animal, pet;
  7.         cout << "\n####Lab 2, Exercise 24####\n";
  8.         cout << "I want to tell you a fancy story, but first i need some info.\n\n";
  9.  
  10.         cout << "What's your <name>?\n";
  11.         getline(cin, name);
  12.         cout << "How <old> are you?\n";
  13.         getline(cin, age);
  14.         cout << "What <city> do you live in?\n";
  15.         getline(cin, city);
  16.         cout << "What <college> do you attend?\n";
  17.         getline(cin, college);
  18.         cout << "What is your <profession>?\n";
  19.         getline(cin, prof);
  20.         cout << "What is your <favorite animal>?\n";
  21.         getline(cin, animal);
  22.         cout << "If you have/want a pet, what would be it's <pet name>?\n";
  23.         getline(cin, pet);
  24.  
  25.         cout << "Press <Enter> to see the story.\n";
  26.         cin.ignore();
  27.  
  28.         cout << "There once was a person named <" << name << "> who lived in <" << city << ">. At the age of \n"
  29.             "<"<< age << ">, <" << name << "> went to college at <" << college << ">. <" << name << "> graduated and went to work\n"
  30.             "as a <" << prof << ">. Then, <" << name << "> adopted a(n) <" << animal << "> named <" << pet << ">. They\n"
  31.             "both lived happily ever after!\n\n";
  32.  
  33.         return 0;
  34.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement