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

Write the pseudocode for the solution to the following problem: You have to prog

ID: 3797683 • Letter: W

Question

Write the pseudocode for the solution to the following problem: You have to program a object to get move through a board without touching the shaded red area The object can start in any one of the four top squares and has to make it to any one of the bottom squares without going into the red square. Write pseudocode that will get the object through the board without going into the red square. The object can only move one space at a time You cannot use a loop in your code Class Diagram For Object Constants SPACE CLEAR NOTCLEAR

Explanation / Answer

Pseudocode is as follows

If the object is at the position 0

moveRight for the 04 steps

else if the object is at the position > 3

moveRight for the 04 steps

Else if the object > 2steps & object == NOTCLEAR && object == position 03

moveRight to the two steps

Else if the object == NOT clear

moveBack to the two steps

Else if the object == current position

MoveRight for the four steps

Else if the object == position 15

MoveAhead one step