Menu

 Imagine you are programming a simulation for a robot that explores areas that are difficult for humans to reach. . . . .

Imagine you are programming a simulation for a robot that explores areas that are difficult for humans to reach. The robot periodically sends the distance it has traveled as input t your program. When the robot reaches its destination, it sends 0. Your task is to write code that reads the values sent by the robot and calculates their total. Assume that an int variable named totalDistance has already been declared and initialized. Write a do-while loop that performs the following steps: Reads an integer as input. This is the distance the robot has traveled. Adds the input to the totalDistance variable. The loop should repeat these steps until the input is 0. When the loop stops, your code should prin the message: Distance traveled: <totalDistance> Where <totalDistance> is the value of the totalDistance variable. Sample Run with Input Shown in <> <10> <4> <6> <12> <0 > Distance traveled: 32 10096

OR