Program 1, Mad Lib Letter
Write a program that allows a user to play a Mad Lib game.
When you finish this program you should have
- Designed, implemented and debugged an interactive text based program.
- Demonstrated your ability to perform string input and output.
- Demonstrated the ability to properly select between getline and the stream extraction operator for string input.
Mad Libs are a simple word game played between a story teller and a participant. The game begins with the story teller selecting a mad lib. The mad lib consists of a story containing a series of blanks, each of which has an associated description. The story teller then asks the participant for a word, matching the given description to fill in each blank. Once this is completed the story teller reads the story filling in the blanks with the participant's answers.
For this program, the computer is to assume the role of the story teller and the user is to assume the role of the participant. There is only one mad lib available for this game. While it contains six blanks, the participant should only be asked for four different answers. Some answers are used twice in the story.
Mr. M. Palin
Owner, name of a business
Dear Mr. Palin,
I am writing this letter to complain about the service at
your name of a business.
I recently purchased a type of animal at this boutique. Once
I returned home, I discovered that the type of animal was
quite dead. When I tried to return it, the clerk said that it was
not dead, merely present continuous verb. I assure you that this
type of animal is not present continuous verb but is indeed
I appreciate your quick resolution of this matter.
For this madlib, you should ask for the following items in the following order.
In this case, a word is a collection of characters containing no spaces, while a phrase is one more words and may contain a space. For example
- a phrase to represent the name of a business.
- a single word naming a location.
- a phrase naming a type of animal.
- a single word naming the present continuous verb. These include words like "squawking" and "sleeping"
Bob the Builder is a phrase.
purple is a word.
Once the input has been obtained, tell the story.
- Make sure you follow all style conventions discussed in class.
- Please make both your code and your I/O neat and organized.
- Make sure your code is well documented.
- Pay attention to the instructions especially where you are asked for a phrase or for a single word.
- If the user is asked for a word and provides additional input, that input should be ignored.
- Please format your output exactly as above, including line breaks and spacing. I will use an automated program to test your results and deviation may result in point deductions.
- If you work with other programmers, be sure to credit them in the comments at the top of the code.
A single file containing the source code for this program.
Submit the assignment to the D2L folder Homework 1 by the due date..