Home / Expert Answers / Mechanical Engineering / please-solve-in-visual-studio-c-q1-making-a-robot-you-are-writing-a-program-that-takes-movement-pa329

(Solved): please solve in visual studio (C++) Q1) Making a Robot You are writing a program that takes movement ...



please solve in visual studio (C++)

Q1) Making a Robot
You are writing a program that takes movement commands for a robot and then outputs the results.
The robot
rlullludddllduudldlllduddrdrdlrludrlullurrlllduuuldrlrlllurlurrrlldrrurdudldduurullluuur
\( 1 \mathrm{R} . .1 \ldots \).
1...
Q1) Making a Robot You are writing a program that takes movement commands for a robot and then outputs the results. The robot itself will navigate a \( 10 \times 10 \) grid, starting at position \( (7,6) \) (where 0,0 is the bottom left position). The robot itself follows each movement instruction one at a time, and to execute that instruction it runs one of the following functions \( \operatorname{north}() \), south(), east() or west(), corresponding to the input directions \( \mathrm{u}, \mathrm{d} \), r or 1 respectively. When the robot runs into a wall ignore the movement and move to the next input. If the robot enters a position for the 8th time, stop processing input: Bad robot! Record how many times the robot bumped into the walls. You don't need to show the robot moving, but after the instructions are entered (on one line), the final result of the "board" should be shown as follows. - Show a "' for a position the robot has never been in - Show a number from 1 to 7 , indicating how many times the robot has entered a position - Show a '*' for the starting position of the robot, unless that is also its final position - Show a ' \( R \) ' for the final position of the robot, unless it has entered a position 8 times - Show an \( X \) if the robot has entered a square 8 times Your program should, at the very least, have a Robot class with the specified move methods. You may use C-style arrays, or the Array/Vector libraries, as you wish. The rest is up to you; use what you have learned. rlullludddllduudldlllduddrdrdlrludrlullurrlllduuuldrlrlllurlurrrlldrrurdudldduurullluuur \( 1 \mathrm{R} . .1 \ldots \). 1...2111.. \( 1.1 .1 \ldots * 1 \) \( 24644 \ldots \). \( 53233 \ldots \). \( 62.2 \ldots \ldots \) \( 4311 \ldots . \). \( 231 \ldots \ldots \) We ran into the edge 7 times.


We have an Answer from Expert

View Expert Answer

Expert Answer


Solution:- The robot itself will navigate a 10 * 10 grid, starting at position (4,7) ( where 0,0 is the bottom left possition ). #include #i
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe