//Sam Partovi CS1A Chapter 3, P. 148, #22
//
/*******************************************************************************
*
* GENERATE PERSONALIZED STORY
* ____________________________________________________________
* This program generates a personalized story with given user information.
* The given information is substited into a template story and outputs
* the result.
* ____________________________________________________________
*INPUT
* name : The user's name
* cityName : The name of the user's city
* age : The user's age
* profession : The user's profession
* animal : A type of animal chosen by the user
* petName : The name to be assigned to the animal
*
******************************************************************************/
#include <iostream>
#include <string>
using namespace std;
int main() {
//Initialize program variables
string name;
string age;
string cityName;
string collegeName;
string profession;
string animal;
string petName;
//Prompt user for inputs
cout << "Enter your name: ";
getline(cin, name);
cout << "Enter your age: ";
cin >> age;
cin.ignore();
cout << "Enter the name of a city: ";
getline(cin, cityName);
cout << "Enter the name of a college: ";
getline(cin, collegeName);
cout << "Enter a profession: ";
getline(cin, profession);
cout << "Enter a type of animal: ";
getline(cin, animal);
cout << "Enter a pet's name: ";
getline(cin, petName);
//Generate the story
cout << "\nThere once was a person named " << name
<< " who lived in " << cityName
<< ". At the age of " << age
<< ", " << name
<< " went to college at " << collegeName
<< ". " << name
<< " graduated and went to work as a " << profession
<< ". Then, " << name
<< " adopted a(n) " << animal
<< " named " << petName
<< ". They both lived happily ever after!" << endl;
return 0;
}