Revision Session Programming Flashcards
Abstraction
Removing detail
Decomposition
Breaking a problem into chunks
Algorithmic thinking
Thinking a structured way, using sequence, selection and iteration
The sun icon doesn’t look like the actual sun
Decomposition use
Break a range of temperatures into hot mild cold
Structure diagram
Linear search algorithm
Look at each item work from beginning to end - slow process
IF it is the value you are looking for
Stop
ELSE move to the next item
REPEAT UNTIL. No more items
Binary search
Split in middle
Take the middle value
IF it is the value you are looking for stop
Bubble sort
Take 2 elements from the list
Swap them depending on order
Repeat until sorted
Linear search for 5 in the list
9,4,8,5,3,6,7
9,4,8,5 (stop)
Binary search for 8 in list
1,2,4,5,7,8
Look at 4 (middle rounded down) Discard lower half (1,2,4) Look at 7 (middle of upper half 5,7,8) Discard lower half (5,7) Look at 8
Why could the binary search not be completed on the first list
(Linear search for 5 in list 9,4,8,5,3,6,7)
Not in order
Explain which search generally finds a value faster?
Binary search
Discards lots of information on each loop / iteration
Bubble sort on list 6,7,10,5,3,9,10
6,7,5,3,9,10,10 (first pass of swaps)
6,5,3,7,9,10,10 (second pass)
5,3,6,7,9,10,10 (third)
3,5,6,7,9,10,10 (final)
Insertion sort on list
F,t,l,k,W,c,a
Merge sort on list
9,4,8,2,10,11,7
9 , 4 , 8 , 2 , 10 , 11 , 7
Pairs first
4,9. 2,8. 10,11. 7
Merge fronts
2,4. 8,9. 7,10,11
Finished
2, 4 , 7, 8 ,9, 10, 11
Which is least efficient sort?
Bubble sort
Name flowchart symbols
What data type for following scenarios?
1 - a phone number 2 - a person age in years 3- true or false 4 - current time in current format 08:00 5 - answer to 1.23 + 2.22
String Int Boolean String Real
Write operator used for == != < <= >= \+ - * / % // **
Define using example
Variable Constant Assignment Sequence Selection Iteration
List 3 boolean operators
AND
OR
NOT
Explain how modulus can be used to identify odd / even numbers
Programming question photo
Explain
Initialising a variable
Give example
Giving a variable a value for the first time
X = 4
Missed photo
Example of what they would give you in that type of question
Code table
Screen shot
Functions
I
If told to make subroutine for display error message
What will get marks for
SQL screen shot
Trace table screenshot
Screenshot