4/6/2025
COMPUTATIONAL
THINKING
GRADE 6 SEMESTER 2
WEEK 1
8CT.03 Identify the important characteristics of pseudocode, including that it
should be short, clear and precise and should have the start and end clearly
shown
8CT.01 Follow and understand algorithms that are presented as pseudocode.
1
4/6/2025
8CT.03 IDENTIFYING PSEUDOCODE
CHARACTERISTICS
• What’s an algorithm?
• Step-by-step instructions for solving a problem.
• What’s a flowchart?
• A pictorial representation of an algorithm.
• What’s a pseudocode?
• A verbal representation of an algorithm.
• Algorithms can be represented as
pseudocodes or flowcharts
PSEUDOCODE
Pseudocodes can be used as a way of planning the structure and function of a
program in a short, clear and precise way.
Below is a sequence of steps. See if you can follow them and perform the
instructions shown
Stand up, take 2 steps forward, clap your
hands twice, take 2 steps back, Sit down,
stand up, jump 3 times, Sit down
Were the instructions clear and precise?
In that same way, a pseudocode must be clear and precise. Pseudocodes are
usually independent of any programming language.
2
4/6/2025
CHARACTERISTICS OF ALGORITHMS
• Should be clear
• Should be precise
• Should have a start and an end
EXAMPLES OF PSEUDOCODES
value1 <- ReadLineFromUser
value2 <- ReadLineFromUser
Printout value1 + value
The pseudocodes shown are designed to
perform the same task. But they are
done slightly in different ways.
Pseudocode has no fixed format
(syntax)
INPUT value1
INPUT value2
OUTPUT value1 + value2
value1 = INPUT
value2 = INPUT
result = value1 + value2
print(result)
Convert this pseudocode to Python code
In pairs, use any of the
approaches to write a
pseudocode algorithm
to find the average of
three numbers.
Another group is going
to evaluate your work.
Again, convert your pseudocode to
Python code
3
4/6/2025
DO YOU REMEMBER THESE FLOWCHART
SYMBOLS AND MEANING?
Convert the
pseudocodes
above into
flowcharts.
do this
individually
Test your
flowcharts using
flowgorithm
IDENTIFY THE IMAGES BELOW.
Flowchart
• Pseudocode or Flowchart?
Below is an algorithm to add two
numbers represented as
pseudocodes.
START
INPUT number1, number2
sum = number1+number2
OUTPUT sum
STOP
Pseudocode
4
4/6/2025
8CT.01 FOLLOW ALGORITHMS THAT ARE
PRESENTED AS PSEUDOCODE - PAIR ACTIVITY
Determine the output of the pseudocode below; if given
name:Azizbek, favouraiteColour:Green and favouriteFood: Rice
INPUT name
INPUT favouriteColour
INPUT favouriteFood
OUTPUT "Hello ", name, " your favourite
food is ", favouriteFood, " and your
favourite colour is ", favouriteColour
MORE PSEUDOCODE EXERCISES
Goto page 34 -37 of your textbook
5
4/6/2025
WEEK 2
• 8CT.02 Follow flowcharts and pseudocode algorithms that use conditional
statements.
• 8CT.07 Predict the outcome of algorithms and test that they meet those
outcomes.
8CT.02 FOLLOW FLOWCHARTS AND PSEUDOCODE
ALGORITHMS THAT USE CONDITIONAL STATEMENTS.
• What is ‘selection’?
The process of choosing between one
or more options, or outcomes.
• How is selection represented in
programming?
‘IF’, ‘THEN’ and ‘ELSE’ are commands
that allow us to perform selection.
• What are the different mathematical
symbols that can be used for
selection?
>, <, >=, <=, <, <> or !=, = or ==
6
4/6/2025
• Use the sets of data below to
follow the flowchart and give me
your result
• 10 and 10
• 5 and 2
• 99 and 3
MORE EXERCISE
Goto page 37- 40 of your textbook
7
4/6/2025
8CT.07 PREDICT THE OUTCOME OF ALGORITHMS AND
TEST THAT THEY MEET THOSE OUTCOMES.
In pairs, predict the outcome of the algorithm below, given the
different age values below
age = INPUT("Enter your age")
Age Outcome
5
print("You are a child")
24
else:
30
print("You are an adult")
18
15
Confirm your answers using Python code.
Develop the algorithm into a flowchart using paper or MS Word
Run it in flowgorithm to test your predicted outcomes
IF age < 18:
MORE EXERCISE – PAIR ACTIVITY
The flowchart
below outputs a
grade depending
on the mark
entered. Predict
the grade
grades given the
marks in the
table below.
Mark
Test your predictions using
flowgorithm. Make corrections
where needed.
Grade
35
46
67
90
87
8
4/6/2025
WEEK 3
8CT.08 Know how to decompose problems into their sub-problems.
8CT.09 Know how to develop algorithms that use at least one constant.
8CT.08 KNOW HOW TO DECOMPOSE PROBLEMS
INTO THEIR SUB-PROBLEMS.
What does the word “decompose” mean to you?
Break down a complex structure into simpler components.
Why do you think we should break a complex problem into smaller tasks?
Because it makes it easier to solve.
Building a House – What are the tasks involved in building a house?
1. Planning and Preparation: define your need and budget, find the right land, hire an
architect, obtain permission etc
2. Laying the foundation: Prepare the site, pouring the foundation, Framing the wall etc
3. Building the shell: Exterior wall, Roofing, windows, doors etc
4. Plumbing and electrical systems: install pipes, electrical wiring etc
5. Interior finishes: Insulation, plastering, painting, tiling etc
6. Final touches: Kitchen and bathroom installations, light fixtures etc
9
4/6/2025
GROUP ACTIVITY ( 3 PER GROUP – 15 MINUTES)
Break down the activities below into several small tasks that
you need to complete them. Assign different tasks to
individual members of your group.
Group
1
2
3
4
Activity
Planning a party
Planning morning routine before school
Cleaning your room
Completing a homework
Present your break down to the class
MIND MAPS
What is decomposition?
Splitting a problem into smaller tasks.
How does decomposition help you solve a problem?
Smaller problems are easier to solve and then join together.
How does decomposition help a team build a program?
Tasks can be split between individual team members
10
4/6/2025
8CT.09 KNOW HOW TO DEVELOP ALGORITHMS
THAT USE AT LEAST ONE CONSTANT.
What does this word mean?
A constant is something that stays the same and cannot
change.
Can you give an example of natural facts that is a
constant?
PIE, the force of gravity, the speed of light in a vacuum etc
CASE STUDY – IN PAIR
• A player has a set number of points at the start
• They lose one of these points each time they are successfully
attacked by another player
• The game ends when all the points have been lost.
Discuss which values do not change in this example.
1. The number of points that the player starts with
2. The number of points that they lose each time they are
successfully attacked
3. The number of points that indicates that the game ends – 0 points.
11
4/6/2025
CONSTANTS
Constant in programming is a memory space that stores a value that cannot be
changed while the program is running. For example, the number of points at the
start of a game = 0.
Note: A constant can only be changed if the program is stopped, the source code
is altered and then the program is run again.
Why Do We Need Constants in Programming?
• They prevent accidental changes.
• If the value needs to be changed, it only needs to be done once and then it will
change automatically throughout the program.
CONSTANT EXAMPLES
OUTPUT 1 * 12
Constant multiplier = 12
OUTPUT 2 * 12
OUTPUT 1 * multiplier
OUTPUT 3 * 12
OUTPUT 4 * 12
OUTPUT 5 * 12
What does the algorithm do?
Performs 12 times table
What is the constant value in this
algorithm?
Number 12 is the same for all five
outputs, so 12 is therefore the
constant.
OUTPUT 2 * multiplier
OUTPUT 3 * multiplier
OUTPUT 4 * multiplier
OUTPUT 5 * multiplier
If you need to program 5 times table by
editing the algorithm above, what would you
do?
12
4/6/2025
MORE EXAMPLES
The algorithm below converts miles to kilometer
1. INPUT miles
3. kilometres = miles * 1.60934
4. Output kilometres
What value do you think will always remain the same in this conversion?
How can we make it a constant in the algorithm?
1. INPUT miles
In pairs, Write an algorithm
2. Constant conversionFactor = 1.60934 to Convert Litres to
3. kilometres = miles * conversionFactor Millilitres with a Constant
4. Output kilometres
WEEK 3
8CT.04 Explain the need for searching algorithms.
8CT.05 Describe and use linear searches.
8CT.06 Understand and use rules using AND, OR and NOT to create logic within
algorithms.
13
4/6/2025
8CT.04 EXPLAIN THE NEED FOR SEARCHING
ALGORITHMS.
Have you searched for something before?
What were you trying to find?
How did you search for it?
What if you have something that can help you find anything?
In the computer we use search algorithms to search for things
Below are some examples of scenarios where search algorithms can be used
Finding the smallest item in a list (How would you do it?)
Finding the largest item in a list
looking for a specific record in a file
Finding a special event in the list of events
Finding an event that happened on a specific date
WHY SEARCH ALGORITHM?
• Why do you think we should use programs to search
for items?
• Helps us in information retrieval
• Helps us in problem solving
14
4/6/2025
SEARCH ALGORITHM – 2 PER GROUP
Algorithms can help us do a lot of things. One of the
algorithms is search algorithm.
Search algorithms are the algorithms or steps that
helps us find a particular item in a dataset.
Open the search algorithm page in your textbook (p.
40 – 42)
LET’S WRITE IT IN A CODE
fruits = ['apple' , 'banana' , 'pear' , 'grape' , 'melon' , 'orange' , 'mango' , 'papaya' , 'raspberry']
count = 0
for fruit in fruits:
print("Position: ", count)
if(fruit == "pear"):
Use online simulator to demonstrate
linear search
print(fruit, " found")
break
count+=1
15
4/6/2025
SUMMARY
• What is a search algorithm?
• Answer: a series of steps that looks for specific data in a set
of data
• Why are search algorithms needed?
• Answer: to find data within a set of data
• Give an example of a search algorithm.
• Answer: a linear search
• How does a linear search work?
• Answer: each item is checked in turn, starting with the first
8CT.06 UNDERSTAND AND USE RULES USING AND, OR
AND NOT TO CREATE LOGIC WITHIN ALGORITHMS.
• What is a conditional statement?
• Answer: A question that has a true or false answer.
• What are the three component parts of a conditional statement?
• Answer: the condition; the code to run if true; the code to run if
not true
• What is the symbol for a condition in a flowchart?
• Answer: a diamond
16
4/6/2025
CONDITIONAL STATEMENTS
• What are the conditional operators that we can use for
conditional statements?
• Answer: <, >, =, !=, <=, >=
Class activity
If you have number 4 AND you are a boy standup
If you have number 2 OR 3 stand up
If you number 5 AND you are NOT a girl stand up
• What will the result of this code be?
• What of this one?
17
4/6/2025
Without using the computer
What will be the result of this code? Write your answer
down as a pair
LET’S
CHECK
EXERCISES - IN PAIRS
• Write Python programs to:
• Take a number as input from the user and check whether it is
greater than 10. Out the number and the message “is greater
than 10 or less than 10” as the case may be.
• Ask the user to guess what number is stored in the computer.
Output ‘Correct’ for a correct guess or ‘Incorrect’ for an
incorrect guess (Use any number of your choice).
• Ask the user to enter a number between 1 and 10 and output
whether they did this successfully or not
18