Programming
Pseudocode vs. Code
| Pseudo-Code | Actual Code |
|
if path is clear
|
if (pathIsClear()) { |
All of the exercises relate to MowerJo at MowerJo.
1. Write code to program MowerJo to move forward one step each time you click the Execute Code button. MowerJo should move only if the path is clear. Set the initial parameters as follows: x = 1, y = 1, direction = South, and Number of gnomes = 0.
2. Write code to program MowerJo to clear an entire row or column when you click the Execute Code button once. MowerJo should not run into the wall. Set the initial parameters as follows: x = 1, y = 1, direction = any, and Number of gnomes = 0.
3. Write code to program MowerJo to move South one step and East one step each time you click the Execute Code button. Set the initial parameters as follows: x = 1, y = 1, direction = anything, and Number of gnomes = 0.
4. Create a flowchart and write code to program MowerJo to cut the perimeter of the lawn. You should program it so that MowerJo does one thing (move or turn) each time you click the Execute Code button. MowerJo should not hit a wall. Set the initial parameters as follows: x = 1, y = 1, direction = South, and Number of gnomes = 0.
5. Create a flowchart and write code to program MowerJo to cut the perimeter of the lawn. You should program it so that MowerJo clears the entire perimeter after you click the Execute Code button once. Set the initial parameters as follows: x = 1, y = 1, direction = South, and Number of gnomes = 0.
6. Create a flowchart and write code to program MowerJo to cut the entire lawn. You should program it so that MowerJo does one thing (turn or move) when you click the Execute Code button. Set the initial parameters as follows: x = 1, y = 1, direction = South, and Number of gnomes = 0.