Revision Session Programming Flashcards

1
Q

Abstraction

A

Removing detail

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Decomposition

A

Breaking a problem into chunks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Algorithmic thinking

A

Thinking a structured way, using sequence, selection and iteration

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q
A

The sun icon doesn’t look like the actual sun

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Decomposition use

A

Break a range of temperatures into hot mild cold

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Structure diagram

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Linear search algorithm

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Binary search

A

Split in middle

Take the middle value
IF it is the value you are looking for stop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Bubble sort

A

Take 2 elements from the list
Swap them depending on order
Repeat until sorted

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Linear search for 5 in the list

9,4,8,5,3,6,7

A

9,4,8,5 (stop)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Binary search for 8 in list

1,2,4,5,7,8

A
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

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)

A

Not in order

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Explain which search generally finds a value faster?

A

Binary search

Discards lots of information on each loop / iteration

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Bubble sort on list 6,7,10,5,3,9,10

A

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)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Insertion sort on list

F,t,l,k,W,c,a

A
17
Q

Merge sort on list

9,4,8,2,10,11,7

A

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

18
Q

Which is least efficient sort?

A

Bubble sort

19
Q

Name flowchart symbols

A
20
Q
A
21
Q

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
A
String
Int
Boolean
String
Real
22
Q
Write operator used for
==
!=
<
<=
>=
\+
-
*
/
%
//
**
A
23
Q

Define using example

Variable
Constant
Assignment
Sequence 
Selection
Iteration
A
24
Q

List 3 boolean operators

A

AND
OR
NOT

25
Q

Explain how modulus can be used to identify odd / even numbers

A
26
Q

Programming question photo

A
27
Q
A
28
Q

Explain
Initialising a variable
Give example

A

Giving a variable a value for the first time

X = 4

29
Q
A
30
Q
A

Missed photo

31
Q
A

Example of what they would give you in that type of question

32
Q

Code table

A
33
Q

Screen shot

Functions

A

I

34
Q

If told to make subroutine for display error message

What will get marks for

A
35
Q

SQL screen shot

A
36
Q

Trace table screenshot

A
37
Q

Screenshot

A
38
Q
A