Question: 1) The attached file maze.cpp is a complete program that represents a simple maze as might be found in an adventure game. a) Create 3

 1) The attached file maze.cpp is a complete program that represents
a simple maze as might be found in an adventure game. a)

1) The attached file maze.cpp is a complete program that represents a simple maze as might be found in an adventure game. a) Create 3 text files end 1.txt, end2.txt and end3.txt that contain the inputs to get three different endings in the maze. An ending has "The end" at the end of the text. 2) Write a program use_cmath.cpp to let the user try a couple functions in the library. We'll include an example from Whittaker's How To Break It that shows the limitations of precision in standard mathematical operations a) #include so you can use the sqrt() and pow() functions b) Prompt the user for a value to work on, then give the user 3 choices of operations: 0. sqrt (val) 1. pow (val, expon) 2. pow (sqrt (val), 4.0) - pow (val, 2.0) c) Use a switch statement to print out the appropriate expression. For the 2nd option, you need to prompt for and read in the exponent as well. Sample run showing the Whittaker example: (What should the answer be?) Lab 2, trying out switch and Enter a value to work on: 2 Choose an operation: 0. sqrt (val) 1. pow (val, expon) 2. pow(sqrt (val), 4.0) - pow (val, 2.0) 2 -2.38419e-007 #include #include using namespace std; int main() { string response; cout > response; if ("east" == response) { cout > response; if ("east" == response) { cout > response; if (north" == response) { cout > response; if ("down" == response) { cout

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!