In this task our objective is to get the frog home, which requires moving around the trees which are blocking the path. We already have a program written for us to achieve this.
Compile the program
Note the fact the compiler tells us there is no error
Run the program
Clearly the required objective wasnt achieved so there is an error in the program. The compiler didnt tell us about the error because it was an error in logic, not programming. Theres no need to throw out the whole program because of this, itll be more efficient to isolate the part of the program that went wrong and change it.
By now it should be obvious that an instruction like frogRight(4) moves the frog 4 squares to the right, and that we can move the frog up, down, and left in the same manner.
Change the instruction "frogUp(7);" so that it reads "frogUp(10);", by simply removing the 7 and inserting a 10 in its place.
Now the program has been edited we have to compile it again, otherwise the computer will run the old version of the program. Click compile.
Run the program to check that it works.