Question: C++ programin (B2DL) This problem is taken from a find your path book of the same name. The idea is you read a passage of

C++ programin (B2DL)

This problem is taken from a "find your path" book of the same name. The idea is you read a passage of text and then decide which

of the presented options you will choose next. If you make good de- cisions, you will win (or in this case, survive). We can represent part

of this book with a flowchart, see figure 1. Paragraphs are indicated with "A" + a number. These also appear at the end of each passage and direct the reader where to read next. You are going to modify

that with a menu option. The reader will select a number and pro- gram execution will jump to that location. You will also notice words

in ALLCAPS. These are boolean variables reflecting your status as you progress through the story. You will need to keep track of these.

The text for each function is listed below. Feel free to copy and paste this text. Re-prompt if incorrect data was entered. Keep re-prompting until the client gets it right. Style guide elements apply: comments, layout, Program Greeting, Source File Header, and variables etc.

Each text passage (A1, A167, etc) is within its own function. Call the functions to progress through the story. You dont need to comment all the functions with this specification comment, just the first one. Hint: Call the functions by the passage identifier - makes your code easier to red. 3. // Specification C2 - Simple menu

Use a simple menu to call the next function. Just add this com- ment to the first one; you dont need to comment all of them. This

can be numeric. "B" Specification Bundle. 1. // Specification B1 - Booleans

When done, display the current state of all the BOOLEAN vari- ables.

2. // Specification B2 - Path Display the path the client took through the story (use the A1, A167, etc. not the menu options) when the story is completed. 3. // Specification B3 - General Menu Code the menu in a general function which accepts up to 3 strings and returns an integer value for the chosen option. Call this from each function to generate your menu at the bottom of the text. 4. //Specification B4 - Valid choices only In A13, there is one option which cannot be taken unless a boolean variable is set. If the variable is set, only offer this option, suppress the other 2. 5. // Specification B5 Function Prototype Use function prototypes and code the functions under main(). "A" Specification Bundle. 1. // Specification A1 - Input Validation

Use input validation to allow only the correct menu values. Re- prompt until proper input is entered.

2. // Specification A2 - No Globals Do not use global variables to pass data around the program. Yes, you can put this comment where globals would normally go. 3. // Specification A3 - Game loop Wrap the program in a loop which prompts you to go again when you finish. 4. // Specification A4 - <> Add one feature of your own choosing.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!