Program 5, Grandmother's Trunk, Again.

Short Description:

Write a program which will play Grandmother's Trunk.

This assignment is worth 25 points.

Goals

When you finish this homework, you should:

Formal Description

Redo program 1, with the following changes.
  1. Correctly identify the article to use with the phrases.
  2. Generate random items to include in the computer's response.
  3. Ask the user if they wish to continue playing the game.
You should create functions to match the following function prototype
  1. string CorrectArticle(string phrase)
  2. string GetPhrase(void)
  3. bool Continue(void)
  4. string UpperCase(string)
  5. string RandomItem(void)
You program should look like:

int turn;
bool flag;
string phrase,
       article,
       story;
....

turn = 0;
flag = Continue();
while (flag) {
     if (turn %2 == 0) {
         item = GetPhrase();
     } else {
         item = RandomItem();
     }
     turn++;

     article = CorrectArticle(item);

     story = story + "\n and " + article + " " + item;
     cout  << story  << PUNCTUATION << endl;
    
     flag = Continue();
}
...

You should use UpperCase as part of Continue.

Discussion

You should make appropriate use of constants and variables.

Your identifiers should be constructed properly, with meaningful names.

You should document your code with comments.

Your program should be fully interactive and provide the user with instructions.

Your output should be organized, easy to read, and make appropriate use of white space.

You should used the functions outlined above.

Required Files

A single source code file.

Submission

Email your final source code file to danbennett360@gmail.com.