Write a C++ program with multiple files to include the following: Functional Requirements:  Create a type of story game by implementing three dynamic stacks that hold words.  The first stack will hold nouns, the second stack will  hold verbs and the third stack will hold adjectives.  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 6  blanks.  You will pull either a noun, verb or an adjective from the appropriate stack as needed for your story.  The story must utilize all three stacks, at least one word from each stack.   You will be creating a linked list to implement this, using pointers. Programming Requirements: Create a looping menu-driven program to demonstrate your code so that the user has the choice of:       1.  Push Noun (push a noun onto the Noun Stack)       2.  Pop Noun (pop a noun off of the Noun Stack)       3.  Push Verb (push a verb onto the Verb Stack)       4.  Pop Verb (pop a verb off of the Verb Stack)       5.  Push Adjective (push an adjective onto the Adjective Stack)       6.  Pop Adjective (pop an adjective off of the Adjective Stack)       7.  Display all three Stacks       8.  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.)      9.  Exit the game 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. Your program should not abruptly exit because of exit_failure -  make sure your high-level validation is working properly! Push:  Words cannot be blank and they cannot be longer than 10 letters.  Pop - validate for stack not being empty. Make a Story - validate that there are enough words on the stacks to fill in all your blanks.  If not, then notify the user what is missing and do not display the story.  Programming Notes: Make sure main() is modular in design and don't forget to document all of your code including your class.  You must implement with three dynamic stacks: adjectives, nouns, verbs. Do not use any C++ stack STL.   Sample Output of the program: **MENU (displayed this time, but in the future, I will just type **DISPLAY MENU for short 1. Push Noun 2. Pop Noun 3. Push Verb 4. Pop Verb 5. Push Adjective 6. Pop Adjective 7. Display All 3 Stacks 8. Make a Story 9. Exit the Game Please choose a menu option: 1 Enter Noun: shoe Cool, thanks for the noun. **DISPLAY MENU Please choose a menu option: 1 Enter Noun: dog Cool, thanks for the noun. **DISPLAY MENU Please choose a menu option: 1 Enter Noun: mitten Cool, thanks for the noun. **DISPLAY MENU Please choose a menu option: 1 Enter Noun: horse Cool, thanks for the noun. **DISPLAY MENU Please choose a menu option: 1 Enter Noun: sandwich Cool, thanks for the noun. **DISPLAY MENU Please choose a menu option: 1 Enter Noun: ice cream Cool, thanks for the noun. **DISPLAY MENU Please choose a menu option: 2 Okay, I have Popped the top word from the Noun Stack

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Write a C++ program with multiple files to include the following:

Functional Requirements: 

Create a type of story game by implementing three dynamic stacks that hold words.  The first stack will hold nouns, the second stack will  hold verbs and the third stack will hold adjectives.  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 6  blanks.  You will pull either a noun, verb or an adjective from the appropriate stack as needed for your story.  The story must utilize all three stacks, at least one word from each stack.  

You will be creating a linked list to implement this, using pointers.

Programming Requirements:

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

      1.  Push Noun (push a noun onto the Noun Stack)

      2.  Pop Noun (pop a noun off of the Noun Stack)

      3.  Push Verb (push a verb onto the Verb Stack)

      4.  Pop Verb (pop a verb off of the Verb Stack)

      5.  Push Adjective (push an adjective onto the Adjective Stack)

      6.  Pop Adjective (pop an adjective off of the Adjective Stack)

      7.  Display all three Stacks

      8.  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.)

     9.  Exit the game

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. Your program should not abruptly exit because of exit_failure -  make sure your high-level validation is working properly!

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

Pop - validate for stack not being empty.

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

Programming Notes:

Make sure main() is modular in design and don't forget to document all of your code including your class.  You must implement with three dynamic stacks: adjectives, nouns, verbs. Do not use any C++ stack STL.

 

Sample Output of the program:

**MENU (displayed this time, but in the future, I will just type **DISPLAY MENU for short
1. Push Noun
2. Pop Noun
3. Push Verb
4. Pop Verb
5. Push Adjective
6. Pop Adjective
7. Display All 3 Stacks
8. Make a Story
9. Exit the Game
Please choose a menu option: 1
Enter Noun: shoe
Cool, thanks for the noun.

**DISPLAY MENU

Please choose a menu option: 1
Enter Noun: dog
Cool, thanks for the noun.

**DISPLAY MENU

Please choose a menu option: 1
Enter Noun: mitten
Cool, thanks for the noun.

**DISPLAY MENU

Please choose a menu option: 1
Enter Noun: horse
Cool, thanks for the noun.

**DISPLAY MENU

Please choose a menu option: 1
Enter Noun: sandwich
Cool, thanks for the noun.

**DISPLAY MENU

Please choose a menu option: 1
Enter Noun: ice cream
Cool, thanks for the noun.

**DISPLAY MENU

Please choose a menu option: 2
Okay, I have Popped the top word from the Noun Stack

**DISPLAY MENU

Please choose a menu option: 3
Enter Verb: chewed
Yay! Thanks for the verb.

**DISPLAY MENU

Please choose a menu option: 3
Enter Verb: exterminate //this shows high level validation
Error: that verb has too many letters
Enter Verb: traveled
Yay! Thanks for the verb.
 
**DISPLAY MENU

Please choose a menu option: 3
Enter Verb: bubbled
Yay! Thanks for the verb.

**DISPLAY MENU

Please choose a menu option: 5
Enter Adjective: messy
Yay! A adjective has been pushed onto the Adjective Stack

**DISPLAY MENU

Please choose a menu option: 7
***Here are your 3 Stacks***
Noun Stack:
(4) sandwich
(3) horse
(2) mitten
(1) dog
(0) shoe
Verb Stack:
(2) bubbled
(1) traveled
(0) chewed
Adjective Stack:
(0) messy
******************end of stack display***********

**DISPLAY MENU

Please choose a menu option: 8
Here is your story:
My **sandwich** was left at home. I **bubbled** but **traveled** on. The **horse** sure was a **messy** guy.
One time he **chewed** on my **mitten**. I sure loved that guy.

**DISPLAY MENU

Please choose a menu option: 7
***Here are your 3 Stacks***
Noun Stack:
(1) dog
(0) shoe
Verb Stack:
This stack is empty
Adjective Stack:
This stack is empty
*****************end of stack display***********

**DISPLAY MENU

Please choose a menu option: 8
Your noun stack doesn’t have enough words to make a story. You will need at least 1 more noun.
Your verb stack doesn’t have enough words to make a story. You will need at least 2 more verbs.
Your adjective stack doesn’t have enough words to make a story. You will need at least 1 more adjective.

**DISPLAY MENU

Please choose a menu option: 9
Thanks for playing the word game!
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 10 steps with 8 images

Blurred answer
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education