-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathA1wordgame.cpp
44 lines (33 loc) · 1.04 KB
/
A1wordgame.cpp
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
// Word game
// By Emily Dayanghirang
#include <iostream>
using namespace std;
int main()
{
string name, city, college, profession, animal, petName;
int age;
// Prompt user
cout << "Enter name: ";
getline(cin, name);
cout << "Enter city: ";
getline(cin, city);
cout << "Enter age: ";
cin >> age;
cin.ignore();
cout << "Enter college: ";
getline(cin, college);
cout << "Enter profession: ";
getline(cin, profession);
cout << "Enter animal: ";
getline(cin, animal);
cout << "Enter pet name: ";
getline(cin, petName);
// Display the story
cout << "\n\nThere once was a person named " << name
<< " who lived in " << city << ".\n"
<< "At the age of " << age << ", " << name << " went to college at " << college << ".\n"
<< name <<" graduated and went to work as a " << profession << ".\n"
<< "Then, " << name << " adopted a(n) " << animal << " named " << petName << ".\n"
<< "They both lived happily ever after!\n";
return 0;
}