Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Philip plans out a program for a window-washing robot on a large, tall building.

ID: 2247215 • Letter: P

Question

Philip plans out a program for a window-washing robot on a large, tall building. The robot must perform the following steps to accomplish its task:

1. Start at the first window on the ground floor.

2. Wash the window.

3. Go to the next window on the same floor.

4. Repeat step2 and 3 until all the windows on that floor are washed.

5. Move back to the first window on the floor.

6. Go to the next floor up.

7. Repeat steps 2 through 6( including the Repeat step)

Assuming that it knows how to do all the individual steps (such as wash a given window) will will this robot be able to complete the task of washing all the windows on a single side of the building? If not, what will happen instead?

Explanation / Answer

I cannot clean all the windows on a single side of a building in certain cases.
    Case 1: Robot does not start from ground floor beacuse the only instruction known by robot is 'Go to the next floor up.'. thus the robot cannot climb down
    Case 2: Robot does not start from a window on the edge, because step 3 instructs 'Go to the next window on the same floor', so the robot can go either Left or Right. If the Robot goes right, it cannot clean the windows on the left. If the Window was on the edge of the building Moving left or right will not leave any window not visited.