← Back

Code Challenge 2 - Mad Lib


Introduction

A mad lib is a simple word game where the player is asked to provide a number of words such as a noun, food, place, verb, adjective, etc. The player is then provided a silly story that has their words inserted into specific places. Try a mad lib here if you’ve never played one before.

Skills to Practice

Challenge Tasks

  1. Create a console project named CodeChallenge2MadLib.
  2. Complete the folowing tasks:
    1. Output a story title at the beginning of your program.
    2. Prompt the user to input two nouns and save them each to a variable.
    3. Prompt the user to input two numbers and save it to a variable.
    4. Output a story that is four lines long. Your story should use the variables throughout and resemble a mad lib game.

In short, when the user plays the game, they should be able to enter some values, and read their custom story.

Sample Output