Question: English description Write a C++ program which allows a user to traverse a 5x5 grid until the user wants to quit. The current position of

English description

Write a C++ program which allows a user to traverse a 5x5 grid until the user wants to quit. The current position of the user is shown after each move. The user starts in the upper left corner on the screen and can at each turn move to the left, right, up or down. The user indicates moves by the following letter inputs (all other letters quit the execution of the program):

'l' or 'L' for left

'r' or 'R' for right

'u' or 'U' for up

'd' or 'D' for down

The user never moves out of the grid. If the user's current position is, for example, in the left-most column and inputs 'l'/'L' then the user moves to the right-most column. If the user's current position is, for example, in the bottom row and inputs 'd'/'D' then the user moves to the top row. The current position of the user is denoted with 'o' on the screen but other points in the grid are shown as 'x'.

Dmi 1 / Example 1

o x x x x x x x x x x x x x x x x x x x x x x x x r x o x x x x x x x x x x x x x x x x x x x x x x x r x x o x x x x x x x x x x x x x x x x x x x x x x d x x x x x x x o x x x x x x x x x x x x x x x x x d x x x x x x x x x x x x o x x x x x x x x x x x x r x x x x x x x x x x x x x o x x x x x x x x x x x r x x x x x x x x x x x x x x o x x x x x x x x x x r x x x x x x x x x x o x x x x x x x x x x x x x x q 

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!