Professional Documents
Culture Documents
MG STUDENTS 13 Selection - Iteration
MG STUDENTS 13 Selection - Iteration
MG STUDENTS 13 Selection - Iteration
Hardware &
Processing
help me write code? 1 School Network
Show an understanding of selection, explain what is meant by iteration 5 You & Your Data
and the difference between for & while loops 6 Social Engineering
7 Computer Misuse
8 Prevent
9 Binary
Representation
Data & Data
10 A splash of colour
Grade Descriptors
1-2 I know what an algorithm is and I can express simple algorithms using symbols.
1-2 I know that computers need precise instructions.
1-2 I can show care and precision to avoid errors 11 Good vibrations
2-3 I know that algorithms are implemented on digital devices as programs.
2-3 I can design simple algorithms using loops, and selection i.e. if statements.
2-3 I can use logical reasoning to predict outcomes.
2-3 I can find and correct errors i.e. debugging, in algorithms. 12 Computational thinking
3-4 I can design solutions (algorithms) that use repetition and two-way selection i.e. if, then and else.
Algorithms
3-4 I can use flowcharts to express solutions.
3-4 I can use logical reasoning to predict outputs, showing an awareness of inputs.
4-5 I can design solutions by decomposing a problem and creates a sub-solution for each of these parts (decomposition). 13 Input, selection & data types
4-5 I know that different solutions exist for the same problem.
5-6 I know that iteration is the repetition of a process such as a loop.
5-6 I know that different algorithms exist for the same problem. 14 Procedures & Functions
5-6 I can represent solutions using pseudocode
5-6 I can identify similarities and differences in situations and can use these to solve problems (pattern recognition).
6-7 I know a recursive solution to a problem repeatedly applies the same solution. 15 Getting to know you
6-7 I know the notion of performance for algorithms and I know that some algorithms have different performance characteristics for the same task.
18 Main Menu
Key Questions
t e n a t i o n ?
What is a variable?W ha t is c o nc a
Why do w W h at is s ele c tion?
e need da
ta types?
What is a sequence?
t co nt ro l led lo o p ?
What is a coun
What is a condition cont
rolled loop?
Lesson intention: Show an understanding of selection, explain what is meant by iteration and the difference between for & while loops
• These are the four different data types we are going to be looking at.
• Data types are the type (category) of data that your variable can hold
Age = 34
Integer Whole numbers only
Lesson intention: Show an understanding of selection, explain what is meant by iteration and the difference between for & while loops
• These are the four different data types we are going to be looking at.
• Data types are the type (category) of data that your variable can hold
This used to store numbers with a
decimal place. Real numbers are Cost = 9.99
Real sometimes referred to as floating Pi = 3.14
point numbers (float for short) Finishtime = 11.54
It is being given a
suitable name and the
data type is being
changed to a string.
Lesson intention: Show an understanding of selection, explain what is meant by iteration and the difference between for & while loops
• Output Properties
Lesson intention: Show an understanding of selection, explain what is meant by iteration and the difference between for & while loops
Use Flowgorithm to
create a flowchart
that will ask the user
for their name, and
then use their name
in a message back
to them.
Lesson intention: Show an understanding of selection, explain what is meant by iteration and the difference between for & while loops
• Selection is when your algorithm has to make a decision.
• At a point in your program you may need to answer a question.
• A decision is when your flowchart has two or more paths to follow. We can
decide the outcome of the decision based on set variables or user inputs.
• We use mathematical operators in our flowcharts to help us make decisions.
• Below are some of the mathematical operators used in Flowgorithm
Lesson intention: Show an understanding of selection, explain what is meant by iteration and the difference between for & while loops
Make corrections to the table to make all of the example
statements true.
Lesson intention: Show an understanding of selection, explain what is meant by iteration and the difference between for & while loops
• Familiar Language
Lesson intention: Show an understanding of selection, explain what is meant by iteration and the difference between for & while loops
We can use more than one selection, this is called nested if. In this, the result of
selection statement moves to another selection statement, this can happen as many
times as we like. Here is an example of a nested if written out.
Lesson intention: Show an understanding of selection, explain what is meant by iteration and the difference between for & while loops
Grade results A* A B C D E FAIL
90 80 70 60 50 40 >39
flowchart
Create a flowchart that will work out
what grade someone has achieved
based on the scores above.
• Inputs.
I used inputs for the name and score
• Concatenation
I used concatenation with ifs
embedded within other ifs
Lesson intention: Show an understanding of selection, explain what is meant by iteration and the difference between for & while loops
Think about boiling a kettle, does the
kettle boil FOR a set amount of time
or WHILE a condition has not been
met?
Repeating = iteration
Lesson intention: Show an understanding of selection, explain what is meant by iteration and the difference between for & while loops
Make this flowchart and explain below what it does.
It prints
1 turn
2 turn
3 turn
4 turn
5 turn
Lesson intention: Show an understanding of selection, explain what is meant by iteration and the difference between for & while loops
Count flowchart
Lesson intention: Show an understanding of selection, explain what is meant by iteration and the difference between for & while loops
Make this flowchart and explain below what it does.
Lesson intention: Show an understanding of selection, explain what is meant by iteration and the difference between for & while loops
Make this flowchart and explain below what it does.
Lesson intention: Show an understanding of selection, explain what is meant by iteration and the difference between for & while loops
Using your understanding of
decomposition and while loops, now
create a piece of code that will check
how much petrol a car has.
Lesson intention: Show an understanding of selection, explain what is meant by iteration and the difference between for & while loops