Question: (In C++, Thank You) 2.1 Specifications 1. Create a function called process that takes in two integer parameters representing the length (number of rows) and

 (In C++, Thank You) 2.1 Specifications 1. Create a function called

(In C++, Thank You)

2.1 Specifications 1. Create a function called process that takes in two integer parameters representing the length (number of rows) and the width (number of columns) of the room. The function returns nothing. (5 points) 2. In main, read in the number of rows and columns from the user and call the process function The main function should have at most 8 lines of code. (10 points) 3. In the process function, dynamically create a 2 dimensional array of chars. Read in the map of the room from the user. (10 points) 4. Search the array to find out the location (row and column as 2 variables) of the exhaust port The port will be in the 0th row or the Oth column. (10 points) 5. Trace the path the proton torpedo will take through the room backwards. (25 points) 6. If we see a mirror, change the direction of the path accordingly. You can use an integer or a char to keep track of the direction you're currently moving. (15 points) 7. Stop when we reach the edge of the room (when we see a "wall" character). Print the location as (row, column) where we reach the wall. (15 points) 8. Delete the dynamic array. (5 points) 9. Include comments wherever you think is appropriate. (5 points) 10. You need to make sure you are never out of bounds. Since this is a dynamic array, it will crash if we go out of the number of rows and columns we have. Sample Run 1 Enter the number of rows: 6 Enter the number of columns: 11 Enter the map: The entry point is (0,3) 2.1 Specifications 1. Create a function called process that takes in two integer parameters representing the length (number of rows) and the width (number of columns) of the room. The function returns nothing. (5 points) 2. In main, read in the number of rows and columns from the user and call the process function The main function should have at most 8 lines of code. (10 points) 3. In the process function, dynamically create a 2 dimensional array of chars. Read in the map of the room from the user. (10 points) 4. Search the array to find out the location (row and column as 2 variables) of the exhaust port The port will be in the 0th row or the Oth column. (10 points) 5. Trace the path the proton torpedo will take through the room backwards. (25 points) 6. If we see a mirror, change the direction of the path accordingly. You can use an integer or a char to keep track of the direction you're currently moving. (15 points) 7. Stop when we reach the edge of the room (when we see a "wall" character). Print the location as (row, column) where we reach the wall. (15 points) 8. Delete the dynamic array. (5 points) 9. Include comments wherever you think is appropriate. (5 points) 10. You need to make sure you are never out of bounds. Since this is a dynamic array, it will crash if we go out of the number of rows and columns we have. Sample Run 1 Enter the number of rows: 6 Enter the number of columns: 11 Enter the map: The entry point is (0,3)

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!