Email us: contact@classs.org.uk

Technorth Family Learning Centre, 9 Harrogate Road, Leeds LS7 3NB

Year 2 & 3 – Cracking Code!

Hi everyone, I hope you’re all doing well. Today we’re going to learn to write computer code. Grown ups – you may need to help your child through this lesson!

First of all, what is computer code? Computer code is a list of steps or instructions. A computer follows this list of instructions in order. The computer will do whatever you tell it to do in each instruction.

With computer code, you can teach a computer to do almost anything.

To keep busy at home, we’ve been building a robot called Marvin. Marvin is really just a computer with arms. Say hello to Marvin!

I want to teach Marvin to make me a cup of tea. Here is what I told him to do:

  1. Turn on the kettle.
  2. Place a tea bag in the cup.
  3. Wait for the kettle to finish boiling.
  4. Pour water from the kettle into the cup safely.
  5. Wait for three minutes.
  6. Take the tea bag out of the cup.
  7. Add a splash of milk to the cup.

Marvin followed my instructions correctly, but I didn’t get a cup of tea. Instead I got a splash of milk in my cup and nothing else!

Can you see what went wrong?

I forgot to tell Marvin to put water in the kettle! Let’s try again, here’s what I told him this time:

  1. Put a cupful of water in the kettle.
  2. Turn on the kettle.
  3. Place a tea bag in the cup.
  4. Wait for the kettle to finish boiling.
  5. Pour water from the kettle into the cup safely.
  6. Wait for three minutes.
  7. Take the tea bag out of the cup.
  8. Add a splash of milk to the cup.

Marvin did make me a cup of tea, but he hurt his hand! Poor Marvin.

Marvin had tried to get the tea bag out of the cup using his hand! I thought he would use a tea spoon. But he didn’t know that, I have to tell him to use a tea spoon. Let’s try one last time:

  1. Put a cupful of water in the kettle.
  2. Turn on the kettle.
  3. Place a tea bag in the cup.
  4. Wait for the kettle to finish boiling.
  5. Pour water from the kettle into the cup safely.
  6. Wait for three minutes.
  7. Take the tea bag out of the cup with a teaspoon.
  8. Add a splash of milk to the cup.

This time, I got my cup of tea and Marvin wasn’t hurt. Success!

We’d like for you to try to teach Marvin to make a peanut butter and jam sandwich. Write some instructions or draw some pictures for Marvin to follow. Use my example to help you.

Steps to Success:

  • Say your ideas out loud first.
  • Use numbers to order your instructions.
  • Use bossy verbs so that Marvin knows exactly what to do.
  • Make sure your steps make sense!
  • Try to use the items in this picture:

Once you have written your computer code, send it to us so we can see if Marvin will make us a sandwich!

Today, we learnt about how to write computer code. If you’d like to learn more about computer code, then have a look at this lesson from bbc bitesize: https://www.bbc.co.uk/bitesize/articles/zkjy382