Question: Language C++ WARNING: YOU MUST use for loop to complete this exercise to receive points In this program, you will simulate the movement of a

 Language C++ WARNING: YOU MUST use for loop to complete this
Language C++

WARNING: YOU MUST use for loop to complete this exercise to receive points In this program, you will simulate the movement of a robot on a plane. The robot starts at position (0,0) and must reach (4.4) in 10 steps. At each iteration the user enters one of the following options: up, down, left, right up increases y coordinate by 1. For example, the robot would go from (0,0) to (0.1) down decreases y coordinate by 1. For example, the robot would go from (0,0) to (0-1) right increases x coordinate by 1. For example, the robot would go from (0,0) to (1.0) left decreases x coordinate by 1. For example, the robot would go from (0,0) to (-1,0) After 10 iterations, print the final coordinates in the format (xy). And the message The robot reached the destination! if the final coordinates are (4.4), or The robot did not reach the destination! otherwise note that it does not matter if the robot passes through (4.4) during its movement. It has to be its final position Any attempt to hard code answers will result in a 0 for the exercise

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!