Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management An Organizational Perspective

Authors: Richard T. Watson

1st Edition

0471305340, 978-0471305347

More Books

Students also viewed these Databases questions

Question

c. What groups were least represented? Why do you think this is so?

Answered: 1 week ago

Question

7. Describe phases of multicultural identity development.

Answered: 1 week ago