Problem Description and Given Info Mad Libs are activities that have a person provide various words, which are then used to complete a short story in unexpected (and hopefully funny) ways Complete the program to read the needed values from input, that the existing output statement(s) can use to output a short story. Ex If the input is Eric Chipotle 12 cars then the output is Eric went to Chipotle to buy 12 different types of cars

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter6: User-defined Functions
Section: Chapter Questions
Problem 31PE
icon
Related questions
Question
Problem Description and Given Info
Mad Libs are activities that have a person provide various words, which are then used to complete a short story in unexpected (and
hopefully funny) ways
Complete the program to read the needed values from input, that the existing output statement(s) can use to output a short story
Ex If the input is
Eric
Chipotle
12
cars
Then the output is
Eric went to Chipotle to buy 12 different types of cars
Transcribed Image Text:Problem Description and Given Info Mad Libs are activities that have a person provide various words, which are then used to complete a short story in unexpected (and hopefully funny) ways Complete the program to read the needed values from input, that the existing output statement(s) can use to output a short story Ex If the input is Eric Chipotle 12 cars Then the output is Eric went to Chipotle to buy 12 different types of cars
mad_lib.py
1# Here is the first input statement that will
2# prompt the user to enter a first name, and will
3# store the user's input in a variable named first name
4# Make no changes to this Line of code.
5 first name input ("Enter a first name :")
6
7 # Write an input statement that will
8# prompt the user to enter a location, and will
9# store the user's input in a variable named generic Location
10 write your location input statement here>
11
12 # Write an input statement that will
13 # prompt the user to enter a whole number, and will
14 # store the user's input in a variable named whole number
15 <write your whole number input statement here>
16
17 # Write an input statement that will
18 #prompt the user to enter a plural noun, and will
Show Transcribed Text
7 # write an input statement that will
8#prompt the user to enter a location, and will
9# store the user's input in a variable named generic Location
10 <write your location input statement here>
11
12 # Write an input statement that will
13# prompt the user to enter a whole number, and will
14 # store the user's input in a variable named whole number
15 <write your whole number input statement here>
16
Load default template...
17 # Write an input statement that will
18 # prompt the user to enter a plural noun, and will
19 # store the user's input in a variable named plural noun
20 <write your plural noun input statement here>
21
22 # the following print statement will display the story to the user
23 # Make no changes to this line of code.
24 print (first_name, "went to', generic_location, 'to buy', whole number, different types of, plural_noun)
Transcribed Image Text:mad_lib.py 1# Here is the first input statement that will 2# prompt the user to enter a first name, and will 3# store the user's input in a variable named first name 4# Make no changes to this Line of code. 5 first name input ("Enter a first name :") 6 7 # Write an input statement that will 8# prompt the user to enter a location, and will 9# store the user's input in a variable named generic Location 10 write your location input statement here> 11 12 # Write an input statement that will 13 # prompt the user to enter a whole number, and will 14 # store the user's input in a variable named whole number 15 <write your whole number input statement here> 16 17 # Write an input statement that will 18 #prompt the user to enter a plural noun, and will Show Transcribed Text 7 # write an input statement that will 8#prompt the user to enter a location, and will 9# store the user's input in a variable named generic Location 10 <write your location input statement here> 11 12 # Write an input statement that will 13# prompt the user to enter a whole number, and will 14 # store the user's input in a variable named whole number 15 <write your whole number input statement here> 16 Load default template... 17 # Write an input statement that will 18 # prompt the user to enter a plural noun, and will 19 # store the user's input in a variable named plural noun 20 <write your plural noun input statement here> 21 22 # the following print statement will display the story to the user 23 # Make no changes to this line of code. 24 print (first_name, "went to', generic_location, 'to buy', whole number, different types of, plural_noun)
Expert Solution
steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT