Lesson Plan: KS3 Computer Science – First Steps To Programming

  • Lesson Plan: KS3 Computer Science – First Steps To Programming

WHY TEACH THIS?

The most important lesson in the world for someone learning to program is finding out how to break down a problem into reasonable, achievable instructions that can be performed by the machine. This process of sequencing allows computer programs to be written for every possible application, from software to robotics.

You’re keen to teach something useful to a bunch of students who’ve got little experience with the nitty-gritty of programming, but you want it to be fun? Well, if that’s your game then this lesson is for you: a full on kinaesthetic activity to engage people with the ‘why’ of programming, and with plenty of opportunity to learn through failing well.

It’s also a bit of fun, and you can even do it outside! Take that opportunity and run to catch the last dying rays of sunlight, breathe in the air and teach something essential in a fun and exciting way.

By the end of this lesson students will be able to:

* Understand how to break instructions down into their simplest, computable parts

* Sequence these instructions together to create simple programs that can be followed

* Debug a simple algorithm as a group.

After this lesson it’s worth getting onto a computer to try out some of this for real, something like LightBot (lightbot.com) works really well to turn these lessons into something that feels more programmable. You could almost immediately take a class through a programming task in Scratch or a written language to better understanding the extent of sequencing.

STARTER ACTIVITY

Students arrive at the lesson to discover a series of individual instructions (e.g. ‘store bags neatly’‘find your seat’ etc.) placed around the classroom. They have to assemble them into the correct order so that you can start your lesson. Make sure you follow them to the letter – if they forget to tell you to face the group, start the lesson speaking to the wall. This allows learners to identify the point of today’s session: giving clear instructions in a logical sequence.

MAIN ACTIVITY

Start by asking some of the class members to hold hands, creating the walls of a simple maze, starting with a straighforward corridor and going as far as L-shaped and maybe even wiggly ones. They will giggle and they will laugh, but here comes the clever bit. You then identify one student to shout out clear instructions (‘the program’) to move through the maze, and another student to follow those instructions (‘the robot’) as literally as he or she can.

The point of this exercise is to allow students to see what assumptions they are making in the instructions they give, so “turn around” becomes a student just spinning on the spot because he hasn’t been given angle or direction to turn in. Through the ‘robot’ trying to be funny by interpreting the instructions as literally as possible the other student will begin to make his instructions more precise, robbing the ‘robot’ of the ability to do anything off-plan or sarcastic.

Once students are able to agree a set of simple instructions and guide their fellows through ever increasing complexities of mazes then put them into small groups to discuss why this should apply to computers? What is the point of the short instruction and why is that important when we’re giving sequences of instructions?

A second task would be to get the groups to build their own APIs for people. In computing, an API (Application Programming Interface) is a list of the instructions that a computer program will accept, along with the variables (options and numbers) that can be given to the commands to change how they work. In small groups the students should start developing their own API – their own list of commands – for controlling the movement of a person through a maze; they’ll need to think about turning, moving, speed, avoiding obstacles, moving things, opening doors, etc.

Finally the groups should try to construct their own complex human mazes and use their APIs to write a sequence that would successfully allow the ‘robot’ to navigate that maze. Handing the instructions over to another team can allow them to build the human-maze, and carry out the instructions to see if they work. Others in the group can critique and suggest improvements to the code. You should use the opportunity here to start asking questions about decision-making, building forward to a next lesson where you introduce IF statements in algorithms to the group. You could even heighten the tension by producing a blindfold at this point, raising the stakes significantly (if you’re going to do that, do be extra cautious regarding health and safety implications).

SUMMARY

The lesson should conclude with a summary of the key points:

* What’s the point of a simple API?

* What’s the point of unambiguous instructions?

* What’s the point of sequencing these instructions?

* How is this relevant to computers and robots?

The end result of which should be that students understand the necessity to be precise and think through the implications of the programs they will soon be writing.

About our expert

David Morgan (@lessonhacker) is an educational technologist with a passion for, and actual qualifications in, Computer Science. He will talk about technology and education all day, if you let him.

Stretch them further

Why not introduce the idea of a ‘subroutine’ where students can take some of their instructions and store them as a separate program that can be ‘called’ by the main process? ask learners to identify what parts of their code are repeated and get them to turn these into subroutines. what are the advantages and disadvantages?

Moving forwards

Introduce the idea of flow charts and if statements as you tackle lightbot or the code.org activities. get the students to document the algorithms they are creating with a flow chart and share the answers amongst the class for peer review.

Home learning

Replace your mum with a robot: Write an API and program to allow a robot to make a cup of tea. Students should be able to create simple instructions and sequence these together to create a simple workflow to follow to make a nice cuppa.