Professional Documents
Culture Documents
Design Technology Grade7 - Term 1: Unit 1: Algorithms and Programming
Design Technology Grade7 - Term 1: Unit 1: Algorithms and Programming
Design Technology Grade7 - Term 1: Unit 1: Algorithms and Programming
Grade7 – Term 1
UNIT 1: Algorithms and
programming
Week Unit Lesson 1 Pages
4
Last week
Lesson 1: Decomposition and algorithms
• What is decompaction?
Number
Score Number
PYTHON PROGRAMMING
●print(“NAME”)
Inputs and outputs
Type casting
Sometimes, you may need to change the data type of a variable. For
example, if you were doing calculations you would need to change
string data to numeric data before using it with a calculator:
Programming constructs
Programming constructs
Selection Repetition
Sequence
Sequence is the simplest programming
Python online
15
Selection
• Selection is a programming construct that
uses decisions.
• Programs that using selection choose
which instructions to execute.
• You can create programs with decisions
by using conditional statements with
relational operators.
• Conditional statements are expressions
that give either a true or false result.
Conditional
operators
In this example:
• Line 1 uses a single = operator for assignment. This will store the value 100 in the variable.
• Line 2 uses two == operators to check if the value in the variable is equal to 200.
Activity 9 , AB. Page 16
https://wordwall.net/play/35287/192/194
18
Using if, elif and else
Condition
#if statement
number = 10
Yes Is A > No
B?
Print A is Print B is
greater greater
conditional statements
In this example:
• Line 3 is a conditional statement using a greater than relational operator.
• Line 4 is the instruction to execute if the conditional statement is true.
• Line 6 is the instruction to execute if the conditional statement is false.
22
Checks Room Temperature
The flowchart shows an algorithm for a program that checks
room temperature.
Program
When the temperature of a room reaches 27 degrees
Celsius, the code block will print a warning message.
Activity 10, AB. Page 17
Python online
Submit your
answers on
Course home
24
Design Technology
Grade7 – Term 1
UNIT 1: Algorithms and
programming
Week Unit Lesson 2 Pages
26
Repetition :
Repetition is a programming construct that repeats instructions ; also
called iteration.
There are three main types of loops that used in repetition.
Count-controlled Loop
Conditional Loop
Conditional Loop
Infinite Loop
Activity 11, AB. Page 18
Python online
1
2
Submit your
answers on
Course home
32
Design Technology
Grade7 – Term 1
UNIT 1: Algorithms and
programming
Week Unit Lesson 3 Pages
36
Programing constructs :
1. Sequence
2. Selection
3. Repetition
Compound Conditionals:
• Advanced programming construct that you can use
in computer programming .
• Type of selection that use two or more conditional
statements connected with logical operators.
• Conditional statements are expressions that give
either true or false.
N D
A
O T
R N
O
Activity 14, AB. Page 21
https://www.liveworksheets.com/gl3166805vf
42
Submit your
Activity 15, AB. Page 22 answers on
Course home
Python online
43
Thanks
!
44