-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwordgame.cpp
More file actions
33 lines (22 loc) · 1.22 KB
/
wordgame.cpp
File metadata and controls
33 lines (22 loc) · 1.22 KB
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
//wordgame program. Oladamola Ola-Buraimo. 03/4/24. This code will take user input for name, age, city, college, profession, animal, and pet's name; and display it in a story.
#include <iostream>
#include <string>
int main() {
std::string name, age, city, college, profession, animal, petName;
std::cout << "Enter your name: ";
std::getline(std::cin, name);
std::cout << "Enter your age: ";
std::getline(std::cin, age);
std::cout << "Enter the name of a city: ";
std::getline(std::cin, city);
std::cout << "Enter the name of a college: ";
std::getline(std::cin, college);
std::cout << "Enter a profession: ";
std::getline(std::cin, profession);
std::cout << "Enter a type of animal: ";
std::getline(std::cin, animal);
std::cout << "Enter your pet's name: ";
std::getline(std::cin, petName);
std::cout << "There once was a person named " << name << " who lived in " << city << ". At the age of " << age << ", " << name << " went to college at " << college << ". " << name << " graduated and went to work as a " << profession << ". Then, " << name << " adopted a(n) " << animal << " named " << petName << ". They both lived happily ever after!" << std::endl;
return 0;
}