Functoinal Requirements

Create a type of story game by implementing two dynamic stacks that hold words. The first stack will hold nouns and the second stack will hold verbs. Then we will use the words to fill in the blanks of a story we have already created. Your story (create your own story) must be at least 2 sentences long and it must have at least 8 blanks. You will pull either a noun or a verb from the appropriate stack as needed for your story. This is built on the idea of AdLIbs...sort of - just have some fun.

Programming Requirements

Create a looping menu-driven program to demonstrate your code so that the user has the choice of:

  • Push Noun (push a noun onto the Noun Stack)
  • Pop Noun (pop a noun off of the Noun Stack)
  • Push Verb (push a verb onto the Verb Stack)
  • Pop Verb (pop a verb off of the Verb Stack)
  • Concatenate (the top two words on the Noun Stack and replace those two words with the resultant concatenation. (Shorten resultant word if necessary.)
  • Add an "s" (to the end of the top word on the Noun Stack)
  • Display Both Stacks
  • Make a Story (Pop words from the appropriate stacks and use them to fill in the blanks of a story that you have created. Display the story.)

Validation rules

Two levels of validation are required: high-level in main (while loop to control user input) and low-level in the mutators which will cause an exit_failure if the strings they receive are not valid.

Push: Words cannot be blank and they cannot be longer than 10 letters.

Pop - validate for stack not being empty.

Concatenate - validate for at least two words on the stack.

Add an S - validate for stack not empty.

Make a Story - validate that there are enough words on the stack to fill in all your blanks. If not then notify user and do not display the story.

Programming Notes

Make sure main() is properly organized into functions and don't forget to document your code including your class. You must implement with two dynamic stacks. 0 points for not using dynamic stacks or for using any C++ STL. Code that does not have two separate stacks (noun and verb) will receive 0 points.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.