Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 1: The Story Generator... In the game Mad-libs, players are asked for parts of speech, such as noun, adjective, or adverb, and those words

image text in transcribedimage text in transcribedimage text in transcribedProblem 1: The Story Generator... In the game Mad-libs, players are asked for parts of speech, such as noun, adjective, or adverb, and those words are plugged into a template sentence to generate a sometimes- funny story. Menu Function Write a function called menu that is called by main when your program starts. Inside your menu function, you should first ask the user which story they want to play. Your question should look like: "Which story would you like to play? Enter the number of the story (1, 2, or 3) or type q to quit: " If the user types q your program should print "good bye" and exit the function. If the user types in an invalid input, for example "17" or "slkerjqoe", you should print "Valid choice not selected." If the user types in a valid story number, the menu function should call the corresponding story function (story1, story2, or story3). The user should be allowed to play the game as many times as they like. After printing the new story, your program should ask again which story they would like to play. "Which story would you like to play? Enter the number of the story (1, 2, or 3) or type q to quit: " Story Functions Write 3 functions named story1, story2, and story3 that each allow the user to play a simple game of Mad-libs. Each function should store the corresponding story template and ask the user for the missing word types to fill in the template. For a story template that looks like this: is a who lives in . Then the story function should print the new sentence with the user entered inputs in place of the word-type placeholders. Pat is a student who lives in Boulder. Use the following template for story1: In the book War of the , the main character is an anonymous who records the arrival of the s in . Ask for the following inputs for story1: "Enter a plural noun: " "Enter an occupation: " "Enter an animal name: " "Enter a place: " Use the following template for story2: , I've got a feeling we're not in anymore. Ask for the following inputs for story2: "Enter a name: " "Enter a state/country: "

Problem 1: The Story Generator In the game Mad-libs, players are asked for parts of speech, such as noun, adjective, or adverb, and those words are plugged into a template sentence to generate a sometimes- funny story Menu Function Write a function called menu that is called by main when your program starts. Inside your menu function, you should first ask the user which story they want to play. Your question should look like: "Which story would you like to play? Enter the number of the story (1, 2, or 3) or type to quit: " If the user types q your program should print "good bye" and exit the function. If the user types in an invalid input, for example "17" or "slkerjqoe", you should print "Valid choice not selected." If the user types in a valid story number, the menu function should call the corresponding story function (story1, story2, or story3) The user should be allowed to play the game as many times as they like. After printing the new story, your program should ask again which story they would like to play "Which story would you like to play? Enter the number of the story (1, 2, or 3) or type q to quit

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual Basic Net Database Programming

Authors: Rod Stephens

1st Edition

0789726815, 978-0789726810

More Books

Students also viewed these Databases questions

Question

2. Identify issues/causes for the apparent conflict.

Answered: 1 week ago