From 6d52e21a854da9a2d475e38890cc777cbe262fff Mon Sep 17 00:00:00 2001 From: zariag Date: Wed, 26 Aug 2026 12:38:37 -0700 Subject: [PATCH 1/2] My madlib --- main.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/main.cpp b/main.cpp index 244b895..df868d9 100644 --- a/main.cpp +++ b/main.cpp @@ -5,13 +5,20 @@ 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; + + //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"; return 0; } From 1b38853dd1ceaf4fc6a8cd471c8ebd1c65de60a7 Mon Sep 17 00:00:00 2001 From: zariag Date: Wed, 26 Aug 2026 12:49:10 -0700 Subject: [PATCH 2/2] Madlib 2 --- main.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index df868d9..0b0c8b6 100644 --- a/main.cpp +++ b/main.cpp @@ -9,6 +9,8 @@ int main() //variable to hold user's first name string firstName; int years; +float distance; +string adj; //asking for users name cout << "Enter your first name: "; @@ -18,7 +20,14 @@ int years; 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"; + 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; }