top of page

Computational Thinking Activities 

PART 1- Decompostion Activities

a) SANDWICH- On a piece of blank paper decompose the following problem:

You need to make a cheese and tomato sandwich.
 

> Break this larger task down into sub-tasks
> Don't write the process of actually making the sandwich just focus on the subtasks

b) GAME- On a piece of paper, decompose the following problem:

 

> You have been asked to develop a quest giving computer game
> Break this problem down into sub-tasks - you do not have to provide the complete solution

 

c) CAR PARK- On a piece of paper, decompose the following problem:

A computerised car park control system is to be developed for a multi-story car park. Identify the main tasks that need to be considered.


> Write down lots of questions about things you need to know about
> Then categorise these questions into related chunks
> Give each chunk a name

d) SHOPPING

Watch http://tiny.cc/decompose from BBC Bitesize. Make a list of the smaller problems involved in going shopping that you see during the video

PART 2- Abstraction Activities

a) ROBOT AIRCRAFT

Here is a short news story. Please read it all the way through:

Robot aircraft are to be tested in UK airspace to help refine systems that control autonomous planes. BAE said it would be carrying out 17 flights, using a converted Jetstream 31 capable of flying itself. Human pilots will handle take-off and landing, but the craft will be autonomous as it navigates 300 miles (482km) from Lancashire to Inverness.


The trial will assess piloting software as well as sensor systems that monitor clouds and other aircraft. To pilot itself, the Jetstream aircraft will use data from satellites as well as on-board identification systems that log radio signals broadcast by transponders on other planes.


In addition, the Jetstream is fitted with a camera that can see other air users even if they are not emitting warning signals. This camera also surveys the skies around the craft to spot bad weather or heavy cloud, allowing the aircraft to adjust its route to avoid turbulence and other "challenging conditions".


TASK: Maureen McCue, head of BAE's research and technology, said the trials were "exciting" and it was working with the UK's National Air Traffic Services to determine how well the autonomous aircraft handled sharing the skies with human-piloted craft.


The news story contains 191 words.Abstract the unnecessary detail from the news story until you have an article containing less than 50 words i.e. you need to lose around 75% of the information.
 

b) CAR DRIVING

Think about driving a car - we know you may not have actually driven one as yet, but you have probably been a passenger in one, many times.

Look at the list below and write down the terms which are relevant only to driving discard the details which are not relevant to the task of driving a car.

Colour of car
Number of seats
Steering wheel
Indicators
Rear view mirrors
Weight of car
Top speed of car
Make of car
Brake pedal
Engine
Hand brake
Horn
Throttle
Doors
Gear stick
Wipers
Lights
Ignition key
Ignition switch
Speedometer
Fuel tank

c) SPOT THE CODE

This next task is to get you to practice spotting only essential details when trying to solve a problem.

The instructions for carrying two tasks have been jumbled up in the list below.

- One set of instructions will work out the square of a number and print it.

- The other set of instructions will work out the average of three numbers.

 

01: Variable a = 3
02: Variable b = 15
03: Print “The square of?? “ + MyNumber?? + “ is “ + Square
04: Total_sum = a + b + c
05: Variable MyNumber = 4
06: Average = Total_sum / 3
07: Square = MyNumber * MyNumber
08: Print “The average is “ Average
09: Variable c = 30

 

Task A: Identify which instructions belong to 'work out the square of a number and print it'.

Put those instructions into the correct order.

 

Task B: Identify which instructions in the list belong to 'work out the average of three numbers'.

Put those instructions into the correct order.

 

Hint: Work back from each print statement

PART 3- Algorithm Activities

Coming soon!

PART 4- Flowchart Activities

a) Write the Pseudo code for a player re-loading their weapon in code

b) Write the pseudo code for a player in Angry Birds hitting a building.

c) Write the Pseudo code for a player in accelerating in Mario Karty!

d) Hang a picture on the wall.

e) Charge a mobile phone fully.

f) Cross a road.

g) Calculate entrance price to a theme park - £45 for adults, £30 for children under 16, £5 for children under 4 and £15 for OAPs.  There is a discount of 10% if purchased online.

PART 5- Pseducode Activities

a) Write the Pseudo code for a player re-loading their weapon in code

b) Write the pseudo code for a player in Angry Birds hitting a building.

c) Write the Pseudo code for a player in accelerating in Mario Karty!

d) Hang a picture on the wall.

e) Charge a mobile phone fully.

f) Cross a road.

g) Calculate entrance price to a theme park - £45 for adults, £30 for children under 16, £5 for children under 4 and £15 for OAPs.  There is a discount of 10% if purchased online.

PART 6- Sequence Activities

a) BED!

Think about getting out of bed in the morning.

List down everything that you do, don't worry about the order at this stage
Next, put each of the steps into the correct sequence
Make sure each of your statements start with a number
Make sure that each of your statements have the action words in CAPITALS

b) TV

The order of a sequence is usually important. The statements below are the steps needed to get a TV on and channel BB1

Using the statements below, write them down in the correct sequence.

SET Volume

SWITCH ON Tv with Remote Control

GET Remote Control

SELECT BB1

SELECT the on screen program guide

PART 7- Selection Activities

a) TAXI!

You have been asked to write a program on paper (use Python syntax) that will show the starting price for a taxi firm.

Depending on the number of passengers there will be a different start price for the journey. For 1 person the start price is £2.50, for 2 people it will be £3.00, for 3 people it will be £3.50 for 4 people it will be £4.00 and for 5 or more there is a flat rate charge of £5.00.

Your program should allow the driver to enter the number of passengers and tells them how much the starting fare is.

Write an algorithm first and then use it to write your program.

b) HOTEL

You have been asked to write a program on paper (use Python syntax) that will show a hotel whether guests want a single room, a double/twin room or a family room.

If there is only 1 person staying then they get a single room, if there are 2 people staying then they get a double/twin room and if there are more than 2 people staying then they get a family room.

Your program should allow the hotel staff to enter the number of guests staying in the room.

Write an algorithm first and then use it to write your program.

PART 8- Iteration Activities

a) DICE ROLL

A programmer is creating a computer game in which the user has to roll a dice three times. They have written the following code. The routine for rolling the dice is written as a sequence below:

 

BEGIN RollTheDice DiceResult(1) = Random Number between 1 and 6
DiceResult(2) = Random Number between 1 and 6

DiceResult(3) = Random Number between 1 and 6

END

 

Rewrite this routine so that it uses iteration. You may use a diagram

b) WHAT WILL HAPPEN?

What will happen when the following program is run? Write the ouput exactly if it is output

 

count = 0

while (count < 9):

     print 'The count is ', count

     count = count + 1

print "Goodbye"

c) ADD UP!

A programmer has been asked to write a totalising program. It will ask for 5 numbers, outputtingthe running total each time the user enters a number.

 

Write an algorithm in pseudocode using a loop, which will perform the logic above.

d) BLAST OFF!

A programmer has been asked to write a countdown program which simply displays thenumbers 10 down to 1, pausing 1 second in between each output, finishing with the message“Blast off!”.

 

Write an algorithm in pseudocode using a loop, which will perform the logic above.

PART 9- Variables and Constants Activities

a) IDENTIFY!

State the ‘data types’ required for the following variables:

> student_name
> student_age

> student_sex

> student_height

> student_first_initial

b) SCHOOL DATABASE- A primary school needs a new program to record new students The school administrator needs to record student data from name and address through to medical / SEN needs etc in a new program. Can you create four columns with the following data in it

COLUMN 1- Variable Name e.g name
COLUMN 2- Variable Type .g. string

COLUMN 3- The purpose of variable

COLUMN 4- Is it a variable or constant

NAME       TYPE        PURPOSE                                   V or C?

dob            date         records date of borth               V

agenow     int             what is the the current age     B

PART 10- Strings/Records/Arrays & Lists Activities

Strings

a) Worksheet 1- Please click here to open the worksheet on strings

Arrays

a) Worksheet 1- Please click here to open the worksheet on arrays

PART 11- Operators Activities

a) Worksheet 1- Please click here to open the worksheet and match the operator signs and meanings

a) Worksheet 2- Please click here to open the worksheet on operators

a) Worksheet 3- Please click here to open the worksheet on operators

PART 12- Testing, Trace Tables and Errors Activities

Testing

a) Coming Soon

Trace Tables

a) Worksheet 1 here

 

Error Management

a) Difference- On a piece of paper describe the differences between ‘Syntax’, ‘Logic’ and ‘Run-Time’ errors. Provide examples to support your answer.

b) Syntax- A syntax error in coding is an error caused by not meeting the required method or way of writing the language.  Can you think of some syntax errors that are commonly found in the English language?, for example, not using a capital letter at the start of a sentence. Look at the program below, what is the syntax error and why?    

 

     Name = raw_input(“What is you name)
    “Hello have a great day”

c) Logic Errors

Logic error occurs when an incorrect answer or value is returned or calculated.  This may not cause the program to stop.  Consider the example below,

    Hours =  10
    Hourly Rate = 5.50
    Pay = 10 x 6.50
    print pay

d) Fix Me!

Look at the code below, it is full of errors, oh dear, I am not happy!  Do a Grace Hopper and find the errors and sort them out? ​
​The correct answer is 55.

  Hours =  10
  Hourly_RateRate = 5.50
  Pay = 10 x 6.50
  print pay

PART 13- Boolean Algebra, Logic Gates and Truth Tables Activities

a) Boolean Algebra

> Coming Soon

b) Logic Gates

> Worksheet 1 here

> Worksheet 2 here

b) Truth Tables

> Worksheet 1 here

> Worksheet 2 here

PART 14- Algorithms In Action- Searches and Sorts Activities

a) Searches

> Binary & Linear Search Worksheet 1 here

> Binary & Linear Search Worksheet 2 here

b) Sorts

> Merge Sort Worksheet 1 here

> Bubble Sort Worksheet 1here

> Bubble Sort Worksheet 2 here

PART 15- Subprograms- Prodcedures and Functions Activities

a) Procedures and Functions Worksheet 1- here

b) Task: A programmer has been asked to write a subroutine which when called will accept a number,double it and output the result.

Write a subroutine, in pseudocode, which will receive the number 3 and output its value,doubled

c) Task: A programmer has been asked to write a subroutine which will accept a string, find the length ofthe string and output the number of characters it contains.

 

Write a subroutine, in pseudocode, which will receive a string and output the number of characters the string contains.

bottom of page