Home > 5th Grade Science > Quizzes > Grades 3, 4 and 5 - Computer Science - Elementary School - Writing Code
Grades 3, 4 and 5 - Computer Science - Elementary School - Writing Code
Fast practice, instant feedback. Timer auto-submits when time’s up.
Avg score: 84% Most missed: “Tom wants Henry to keep walking forwards. Which one of these keeps Henry walking…”

Rhea is using a computer to draw shapes. A hedgehog on the computer screen walks round the different shapes. Rhea is writing code to get the hedgehog to draw the correct shape on the computer screen. In the quiz below, Rhea is programming the hedgehog to draw a rectangle. The rectangle must be 30cm long and 20cm deep.

Tom has a character on his computer screen. The character is called Henry. Tom wants to animate Henry and make him walk around the screen. In the quiz below, what code is Tom writing to make Henry walk?

Remember, all the steps in a program have to be in the correct order.

Grades 3, 4 and 5 - Computer Science - Elementary School - Writing Code
Time left 00:00
20 Questions

1. The hedgehog is now in the bottom left-hand corner of the screen.

How many sides of the rectangle has the hedgehog drawn so far?
2. The hedgehog is in the top-right corner. Rhea wants to make the hedgehog turn the corner so it is ready to walk down the screen. What does Rhea code?
3. Rhea has drawn a rectangle 30cm by 20cm. Her teacher now asks Rhea to draw a rectangle 15cm by 10cm using the hedgehog.

Rhea’s first line of code was: Forward 30cm.

What is Rhea’s new first line of code?
4. The hedgehog is now in the bottom right of the screen. Rhea needs to turn the hedgehog so it is facing left, along the bottom of the screen. What code does Rhea write?
5. Rhea now writes the code: Forward 30cm.

What does the hedgehog do?
6. Tom wants Henry to walk forward two steps, turn right, walk forward two more steps, then stop. What does Tom code?
7. Next, Henry needs to swing his left leg forwards. It must go in front of the right leg.

What does Tom code?
8. The hedgehog has now drawn a complete rectangle. How many sides has it drawn?
9. Now, Henry’s right leg needs to go in front of his left leg. Tom codes:
10. Tom’s codes must be in the right _____.
11. Rhea makes the hedgehog finish the rectangle. The rectangle is 20cm deep. What is her last line of code?
12. Tom wants Henry to move two steps forward and then stop. What should he code?
13. Tom wants Henry to keep walking forwards. Which one of these keeps Henry walking?
14. The right leg now needs to move twice as far. Then it will be in front of the left leg.

What does Tom code?
15. The rectangle must be 20cm deep. What does Rhea code next?
16. Tom now wants Henry to go forward two steps, turn left, walk forward two steps, then turn left again, and then stop.

What code does Tom use?
17. Henry is stood up on two legs. Tom wants Henry to start walking with his left leg.

What code does Tom use?
18. The hedgehog starts in the top left-hand corner of the screen. The hedgehog is ready to go. Remember, the rectangle must be 30cm long. What is Rhea’s first line of code?
19. Tom can keep writing: Left Forward 2 Right Forward 2 again and again.

But there is a lot to write down. So, Tom gives these codes a name. He calls them Walk.

Now when Tom just writes Walk, what does Henry do?
20. The hedgehog is still in the bottom left-hand corner of the screen. The hedgehog is still facing to the left. Rhea wants to make the hedgehog face upwards. What should Rhea code?