Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 21 additions & 5 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,29 @@ using namespace std;

int main()
{
// I. Variable declaration


// II. Prompt the user for input and get their responses

//variable to hold user's first name
string firstName;
int years;
float distance;
string adj;

//asking for users name
cout << "Enter your first name: ";
cin >> firstName;
cout << "Long ago there was a traveler named " << firstName << ".\n\n";


// III. Display the mad lib story
cout << "Enter a whole number: ";
cin >> years;
cout << firstName << " was banished from their country " << years << " years ago because they were not strong enough as a warrior.\n\n";

cout << "Enter a decimal number: ";
cin >> distance;
cout << "In order for " << firstName << " to prove themselves, they decided to travel " << distance << " miles to find a dragon to fight.\n\n";

cout << "Enter an adjective: ";
cin >> adj;
cout << "The dragon was " << adj << ", but " << firstName << " was able to defeat it.";
return 0;
}