C A robot travels across a 30 foot room Every 12 inches it t

(C++)

A robot travels across a 30 foot room. Every 12 inches it travels it indicates that it has traveled \'x feet\'. The user inputs how far across the room it want the robot to go. Upon arrival at the specified distance, it announces...\"I made it!\"(This will happen even if the robot moves 0 feet). The program should also indicate how many more feet the robot could travel before running into a wall.

i.e. for an input of 5, the resulting output should be:

Solution

int a,n,remaining;

cin >> a

remaining=roomsize - a;

while (x)

{

n=x;

cout<<\"I have reached \"<<n-x<<\"/n\";

x--;

}

cout <<\"Remaining distance \"<<\"remaining\"

Note: considering x input is given by robot

(C++) A robot travels across a 30 foot room. Every 12 inches it travels it indicates that it has traveled \'x feet\'. The user inputs how far across the room it

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site