Draw the path of the robot through the grid below if the following program is executed (the robot starts in the square marked by the ↑ facing in the direction of the arrow) - AQA - GCSE Computer Science - Question 9 - 2021 - Paper 1
Question 9
Draw the path of the robot through the grid below if the following program is executed (the robot starts in the square marked by the ↑ facing in the direction of the... show full transcript
Worked Solution & Example Answer:Draw the path of the robot through the grid below if the following program is executed (the robot starts in the square marked by the ↑ facing in the direction of the arrow) - AQA - GCSE Computer Science - Question 9 - 2021 - Paper 1
Step 1
Execute Forward(2)
96%
114 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
The robot moves 2 squares forward from its starting position, resulting in it being at (1, 0).
Step 2
Execute TurnLeft()
99%
104 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
The robot turns left, now facing the upward direction.
Step 3
Execute Forward(1)
96%
101 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
The robot moves 1 square forward, advancing to (1, -1).
Step 4
Execute TurnRight()
98%
120 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
The robot turns right, now facing the right direction.
Step 5
Execute Forward(1)
97%
117 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
The robot moves 1 square forward, reaching (2, -1).