Activity: Hangman! Integration (iPad)

Working with two partners, you will continue writing a C++ program which simulates a primitive game of Hangman. You will integrate a set of functions that will be used in the program, and then test the (incomplete) program.

The Assignment

Working with two partners, examine the Box Notes found in the Box folder for Hangman. These notes contain functions and the function prototypes, one of which you and your partners created. In this activity, you will integrate those functions into a larger Hangman! program. –

Step #1: Download the Hangman.cpp file. This file contains code relevant to the Hangman! program, but needs the functions from the Box folder to help it work. Add those functions to your code (don’t forget the prototypes!) and make sure the code compiles. Do not modify the main function (yet). There is no need to run the program.

Step #2: You will now need to add code to call the functions. Look for the comments which begin with the following marker:

/*** STUDENT: ...

Replace these comments with calls to the function(s) requested. Note that you will need to provide the functions with the proper arguments, so examine the main function code to see what variables are available, as well as to understand the general logic of the program. Do not modify the other code. Make sure the code compiles before moving on to the next step.

Step #3: Run the program and try the game. Does it work? Note that you can see the set of words the program chooses in the randomlyChooseSolution function. You should try winning and losing the game, multiple times, to see if it works.