Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In the word game Mad Libs, people are asked to provide parts of speech such as nouns, verbs, adverbs, or adjectives. These words are used
In the word game Mad Libs, people are asked to provide parts of speech such as nouns, verbs, adverbs, or adjectives. These words are used to fill in the blanks of a template or to replace the same parts of speech in a sentence. In this task you're going to write a program to demonstrate how the game works for a single sentence. Consider this sentence from Ready Player One by Ernest Cline: A lich was an undead creature, usually an incredibly powerful wizard or king who had employed dark magic to bind his intellect to his own reanimated corpse, thus achieving a perverted form of immortality. Write a program that will do the following: Prompt the user for one verb, four nouns,and three adjectives Print the sentence above but with words replaced as follows: A [noun] was an undead [noun], usually an incredibly powerful [noun] or king who had employed [adjective] magic to [verb] his [noun] to his own [adjectivel corpse, thus achieving a [adjective] form of immortality. Your program should have three functions and use function calls as appropriate. It should end with a call to main (). Note that the main ) function doesn't require a return statement because the main) call doesn' t have a body or a parameter. Include the f ollowing functions: . get.sent-part ): Prompts user for part of speech; called multiple times from main) . build-sentence () : Uses string concatenation, i.e., combining string using the plus sign, as appropriate to build the sentence from the user's words and the sentence words
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started