Homework #13 (Due: Mon 23 Feb)

This assignment introduces the concept of writing a method that ...
...ters. It is based on a game I played as a kid called \lq\lq Mad

If you are not familiar with ``mad libs'' then this assignment might be a bit confusing. Please call me or come see me to clarify any questions.

When I was a kid my brother was given a little booklet of ``mad libs''. It contained very short stories in which certain words were left blank with the ``type'' of word indicated below the blank. For example, one sentence might read:

Tom went to the   .

The game was played with at least two people. One person would ask the others to provide words for each blank without revealing the context. At the end the story would be read with the blanks filled in.

For this assignment you will write a one-sentence ``mad lib'' that has at least 3 ``blanks''. Create a method to display the story. The ``blanks'' are to be filled in as parameters. In main call the method twice, resulting in the sentence being displayed two times (but with different words for the blanks). One of the three required blanks should be a number (i.e., an int).

One of your method calls should have actual parameters that are constants (selected by you). The other method call should be composed of values obtained from the user.

You are welcome to make the one-sentence ``story'' more elaborate if you would like. Have fun! I look forward to seeing your program!


Quick Links