Topic 1 - Introduction
Topic 1 - Introduction
Topic 1:
Introduction
Learning Outcomes
Instructions - Activity
Instructions
High-level Language
• High-level means it is at human-level.
• It uses words that are usually in English for
example IF, WHILE, INPUT, OUTPUT.
• It is easier for humans to read and write than low-
level.
• High-level languages need to be translated into
low-level languages before a computer can run
them. This is done using a translator (compiler or
interpreter).
Introduction -Topic 1 - 1.13
Python
Why Python?
• Python is a popular language (especially for learning to program)
because of its readability and intuitiveness
• Compare how these different languages output the same statement and
which is most straight forward.
Langua Program statement
ge
VB.NET Console.writeline("Hello World")
Checkpoint Summary
• Computers execute instructions
• Low-level languages include binary and assembly
• Low-level languages are executed by the computer
• High-level languages are human-friendly
• High-level languages need translating to a low-level
language
• Python is an example of a high-level language
• Python is intuitive and easier to use/write/program
than some other high-level languages
Introduction -Topic 1 - 1.17
https://peterhigginson.co.uk/lmc
Introduction -Topic 1 - 1.18
Maintenance
Design
Implementation Programming
(development)
Testing
Introduction -Topic 1 - 1.22
Stage 1: Analysis
Stage 1: Analysis
Stage 2: Design
Stage 3: Programming
Stage 4: Testing
Stage 5: Implementation
Stage 6: Maintenance
(Boehm, B. 1983)
Introduction -Topic 1 - 1.33
Designing Programs
Algorithms
Pseudocode
Pseudocode Structure
Pseudocode Example
Pseudocode Example
• The pseudocode
algorithm is not specific
to one language.
INPUT number
• It has variables and number = number + number
assignment. OUTPUT number
number2 = INPUT
• It has input and output. number3 = number2 * number
• A programmer can Print(number3)
Pseudocode vs Python vs
VB.NET
INPUT number number = input()
number = number + number number = number + number
OUTPUT number print(number)
number2 = INPUT number2 = input()
number3 = number2 * number number3 = number2 * number
Print(number3) print(number3)
Sequence
• A sequence is when each instruction is run once,
one after the other, in the order they are written.
• For example:
Stand up
Sit down
Clap your hands
• This is a sequence because first you would stand
up, then you would sit down, then you would clap
your hands.
Introduction -Topic 1 - 1.41
Sequence Activity
Selection
• Selection has a condition.
• The condition is checked and is either true or false.
• If the condition is true, one section of code will run.
• If the condition is false, a different section of code
will run.
• Sometimes if the condition is false there is no code
that will run.
Introduction -Topic 1 - 1.43
Selection
• One type of selection is an IF statement.
• The condition compares data. For example:
2 < 3?
The condition is true because 2 is less than 3.
• Another example:
Is 10 = 11?
The condition is false because 10 does not equal 11.
Introduction -Topic 1 - 1.44
IF 10 > 20 THEN
Clap your hands
ENDIF
IF 20 = 20 THEN
Stand up
ENDIF
Introduction -Topic 1 - 1.45
Iteration
• To iterate, or reiterate, means to do something more than
once. To repeat.
• Iteration in code is when statements can run multiple times.
• They are often called loops, because the code loops.
• There are two main loops that are used in Python:
• FOR
• WHILE
Introduction -Topic 1 - 1.46
Quiz
Topic Summary
What Is Next?
References
Any Questions?