Lucy
Ask the AI Tutor
Need help with Code - How to Write Code 1? Ask our AI Tutor!
Lucy AI Tutor - Lucy
Connecting with Tutor...
Please wait while we establish connection
Lucy
Hi! I'm Lucy, your AI tutor. How can I help you with Code - How to Write Code 1 today?
now
Logo

Computing Quiz - Code - How to Write Code 1 (Questions)

Writing code means choosing clear instructions for a computer to follow. In this quiz, you will pick the right commands, put them in order, and fix simple mistakes.

Explore the Topic →
(quiz starts below)

Fascinating Fact:

Change one thing at a time when you are improving your code. This makes it easier to see what the change did.

In KS1 Computing, children learn that code is a set of instructions that controls what happens in a program. When you write code, you choose commands to make something move, speak, or change on screen. If the program does not work the way you want, you can test it, spot the problem, and make a small change, then try again to see what improved.

  • Program: A set of coded instructions that makes something happen.
  • Command: One instruction in code, like move or play a sound.
  • Bug: A mistake that stops a program working properly.
How do you write code for KS1?

To write code for KS1, you choose simple commands and put them in order so the computer can follow the instructions, then you test the program to check it works.

What is a bug in code for kids?

A bug is a mistake in the code that makes the program do the wrong thing or stop working, and you fix it by changing the instructions.

How can I fix my code if it goes wrong?

You can fix code by checking each step, finding where it changes or stops, and making a small edit, then testing again to see if the program works better.

1. 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 Ella’s first line of code?
[ ] Forward 20cm
[ ] Forward 30cm
[ ] Forward 50cm
[ ] Stop
2. The hedgehog is in the top-right corner. Ella wants to make the hedgehog turn the corner so it is ready to walk down the screen. What does Ella code?
[ ] Turn right
[ ] Turn left
[ ] Go back 30cm
[ ] Go back 50cm
3. The rectangle must be 20cm deep. What does Ella code next?
[ ] Forward 10cm
[ ] Forward 20cm
[ ] Forward 30cm
[ ] Forward 50cm
4. The hedgehog is now in the bottom right of the screen. Ella needs to turn the hedgehog so it is facing left, along the bottom of the screen. What code does Ella write?
[ ] Turn right
[ ] Stop
[ ] Go
[ ] Turn left
5. Ella now writes the code: Forward 30cm.

What does the hedgehog do?
[ ] Moves 30cm backwards
[ ] Moves 20cm forwards
[ ] Moves 30cm forwards
[ ] Moves 50cm forwards
6. 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?
[ ] 1
[ ] 2
[ ] 3
[ ] 4
7. The hedgehog is still in the bottom left-hand corner of the screen. The hedgehog is still facing to the left. Ella wants to make the hedgehog face upwards. What should Ella code?
[ ] Turn right
[ ] Turn left
[ ] Turn round
[ ] Turn back
8. Ella makes the hedgehog finish the rectangle. The rectangle is 20cm deep. What is her last line of code?
[ ] Forward 30cm
[ ] Stop
[ ] Back 20cm
[ ] Forward 20cm
9. The hedgehog has now drawn a complete rectangle. How many sides has it drawn?
[ ] 1
[ ] 2
[ ] 3
[ ] 4
10. Ella has drawn a rectangle 30cm by 20cm. Her teacher now asks Ella to draw a rectangle 15cm by 10cm using the hedgehog.

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

What is Ella’s new first line of code?
[ ] Back 15cm
[ ] Back 30cm
[ ] Forward 15cm
[ ] Forward 20cm

You can find more about this topic by visiting BBC Bitesize - What is a computer program?

Logo
Computing Quiz - Code - How to Write Code 1 (Answers)
1. 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 Ella’s first line of code?
[ ] Forward 20cm
[x] Forward 30cm
[ ] Forward 50cm
[ ] Stop
The hedgehog walks 30cm right across the top of the screen
2. The hedgehog is in the top-right corner. Ella wants to make the hedgehog turn the corner so it is ready to walk down the screen. What does Ella code?
[x] Turn right
[ ] Turn left
[ ] Go back 30cm
[ ] Go back 50cm
The hedgehog turns right, ready to go down the screen
3. The rectangle must be 20cm deep. What does Ella code next?
[ ] Forward 10cm
[x] Forward 20cm
[ ] Forward 30cm
[ ] Forward 50cm
The hedgehog moves down the screen 20cm. Ella has drawn two sides of the rectangle
4. The hedgehog is now in the bottom right of the screen. Ella needs to turn the hedgehog so it is facing left, along the bottom of the screen. What code does Ella write?
[x] Turn right
[ ] Stop
[ ] Go
[ ] Turn left
Tricky! If the hedgehog turns left, it will go off the screen in the wrong direction!
5. Ella now writes the code: Forward 30cm.

What does the hedgehog do?
[ ] Moves 30cm backwards
[ ] Moves 20cm forwards
[x] Moves 30cm forwards
[ ] Moves 50cm forwards
The hedgehog has now drawn another side of the rectangle
6. 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?
[ ] 1
[ ] 2
[x] 3
[ ] 4
Altogether, a rectangle has 4 sides. The hedgehog has drawn 3 of the sides so far
7. The hedgehog is still in the bottom left-hand corner of the screen. The hedgehog is still facing to the left. Ella wants to make the hedgehog face upwards. What should Ella code?
[x] Turn right
[ ] Turn left
[ ] Turn round
[ ] Turn back
If the hedgehog turns right, it is soon facing in the right direction
8. Ella makes the hedgehog finish the rectangle. The rectangle is 20cm deep. What is her last line of code?
[ ] Forward 30cm
[ ] Stop
[ ] Back 20cm
[x] Forward 20cm
The hedgehog is now back where it started
9. The hedgehog has now drawn a complete rectangle. How many sides has it drawn?
[ ] 1
[ ] 2
[ ] 3
[x] 4
A rectangle has 4 sides. How many sides has a triangle?
10. Ella has drawn a rectangle 30cm by 20cm. Her teacher now asks Ella to draw a rectangle 15cm by 10cm using the hedgehog.

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

What is Ella’s new first line of code?
[ ] Back 15cm
[ ] Back 30cm
[x] Forward 15cm
[ ] Forward 20cm
How much smaller is 15cm than 30cm? - It is half as long