Introducing
Your new presentation assistant.
Refine, enhance, and tailor your content, source relevant images, and edit visuals quicker than ever before.
Trending searches
Code inside is repeated a fixed number of times
We can set the values of the loop using variables
We tell the computer how many times we want to repeat - initial value, end value, step value
Programming basic
Instructions executed in the correct order - if not we don't get the result we expect!
All about controlling what parts of your code get executed and which parts don't!
Imagine tying your laces before you have put you shoes on!
If no step value is given, we step by 1
There are 4 iteration (loop) statements that you need to know about.
In 60 seconds, explain to the person sitting next to you the difference between all of the loops we have learned about today - no looking at your revision resource!
IF a condition is true, then perform this action
ELSE perform that action
IF ELSE gives us two options,adding ELIF gives us
∞
options!
3 data types and what they are used for
+ Neater than big elif statements
+ Easier to maintain
- Only check the value of one variable unlike an IF
- Not all languages support the use of them
Instead of checking if something is true or false, a switch case checks if a variable has a specific value
2 disadvantages of a merge sort
1 explanation of the fetch, decode, execute cycle
Different actions for different values on the same variable
Controlled by a condition at the end of the loop
Always runs code AT LEAST ONCE
In this loop, we repeat whilst the condition is FALSE
Rather than repeat a set number of times, these loops repeat until a condition is met
Also controlled by condition at the end
DO WHILE true
Also always runs the code at least once
Create a set of flashcards/revision poster/mind map to explain FOR, REPEAT, WHILE and DO WHILE loops
Condition comes first
If condition is false to begin with it won't execute the conditional code at all
Keep going while the condition is true
If statements and Switch Case statements enable us to use selection