2.1 - 2.5 Flashcards

(71 cards)

1
Q

What is abstraction?

A

Removing unnecessary detail from a problem

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

What is an algorithm?

A

A sequence of steps that can be followed to complete a task.

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

What is algorithmic thinking?

A

Solving problems by defining the steps and the sequence needed.

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

What is decomposition?

A

Breaking a problem into sub-problems that each represent a specific task.

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

What are Trace Tables?

A

Tables that show how values change when an algorithm is carried out.

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

What are the steps of a trace table

A

Go through every line

Only add to a column when it’s value changes

Move onto a new row when you move into a new block in the code

Gaps are fine!

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

How does linear search work?

A

Compares each item one by one until the target is found.

List doesn’t need to be in order

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

How does binary search work

A

Compares middle item to the target

Discards half of the list which the target can’t be in

Finds the next middle item, and repeats until the target is found/ runs out of items

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

What are the advantages of binary search?

A

More time efficient than linear search

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

What are the disadvantages of binary search?

A

List must be in order beforehand.

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

What are the steps of bubble sort?

A

In one pass, go through each pair swapping if needed.

Repeat passes until a pass happens with no swaps

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

What are the steps of merge sort?

A

Divide the list continuously by two until each list has 1 item.

Then combine two lists at a time keeping the items in order

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

What are the steps of insertion sort?

A

Start with 1 item in the sorted part

move items one by one from the unsorted part to the sorted part.

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

What do data types determine?

A

How data is stored and its operations.

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

What is casting?

A

Changing the data type of data.

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

What are the 5 arithmetic operators?

A

Multiplication: *
To the power of: ^
Division: /
Integer division: DIV
Remainder division: MOD

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

What are the 4 comparison operators?

A

Equal to: ==
Not equal to: !=
Greater than: >
Greater than equal to: >=

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

What are the 3 Boolean operators?

A

NOT

AND

OR

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

What are the 5 data types?

A

Integer: A whole number

Real: A whole number with a fraction

Boolean: True or False

Character: A letter, number or symbol

String: A group of characters

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

What are the two string handling functions?

A

Substring: .substring(Starting index, howMany)

Concatenation (Joining two strings) : +

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

What are Variables?

A

Named Identifiers that hold a value that can be changed.

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

What are constants?

A

Named identifiers that hold a value and cannot be changed.

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

What data type is a user input WITHOUT casting?

A

String

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
How do you generate random values?
Random(startingNUM, endNUM)
26
What are the 3 fundamental programming constructs?
Sequence Selection Iteration
27
What are the two types of Iteration?
Count-controlled loops Condition-controlled loops
28
What are two examples of condition-controlled loops?
WHILE loops DO UNTIL loops
29
What is a FOR loop (count-controlled)?
A loop that repeats a set number of times
30
What is WHILE loop?
A loop that repeats until a condition is broken.
31
What is a DO UNTIL loop?
A loop that repeats until a condition is met.
32
What are four features of maintainable code?
Built from many sub programs Consistent in its naming conventions Consistent in indentation Uses comments to explain code
33
What is a local variable?
A variable that only exists when the subprogram is executing. A variable only accessible inside the subprogram
34
What are data structures?
Organised collections of items
35
What is an array?
A list containing items of the same data type A list of a fixed length
36
What is SQL SELECT used for?
To search and retrieve data
37
What is the structure of SQL Code?
SELECT 'x' / * FROM 'y' WHERE 'z'
38
What does a * represent in SQL?
All data
39
What is the structure of a 2D array?
array Example = [ [First array], [Second array] ]
40
How do you open a file?
textFile = open("x.txt")
41
How do you write a line on a file?
textFile.writeLine("")
42
How do you identify the end of a file?
textFile.endOfFile()
43
How do you read a file line?
textFile.readLine()
44
How do you close a file?
textFile.close()
45
How many file lines can you read at a time?
ONE
46
What are the two types of testing?
Iterative Terminal
47
What is terminal testing?
Testing of the whole program at the end of development
48
What is iterative testing?
Testing of modules throughout development
49
What are the two types of errors?
Syntax Error Logic Error
50
What is a syntax error?
Not Following the rules of the language. Code won't run.
51
What is a logic error?
Code doesn't run as intended. Code runs, but results are unexpected.
52
What different test data should be used, to test for robustness?
normal data boundary data invalid data Erroneous data
53
What is Erroneous data?
Completely wrong + incorrect data type
54
What is invalid data?
Completely wrong Correct data type
55
What is authentication?
Checking the identity of a user e.g. password checkers
56
What is validation?
Enforcing a rule around user input
57
What is disjunction?
An OR gate
58
What is negation?
A NOT gate
59
What is conjunction?
An AND gate
60
What are the advantages of a high level language?
Like written English More readable Can run on many CPUs
61
What are the disadvantages of a high level language?
Slower to execute
62
What are the advantages of a low level language?
Easier to optimise
63
What are the disadvantages of a low level language?
Specific to particular CPUs
64
What are translators?
Programs that convert one programming language to another.
65
What are the two types of low level language?
Assembly code Machine code
66
What do compilers and interpreters do?
Convert high-level code to machine code
67
What are the advantages of a compiler?
Produces an executable file No source code needed afterwards Fast to execute afterwards
68
What are the advantages of an interpreter?
Translates an instruction, then executes it Errors discovered straight away
69
What are the disadvantages of an interpreter?
Source code needed to run
70
What are the disadvantages of a compiler?
Errors are only shown right at the end
71
List three ways IDEs support programming:
Providing an editor Providing error diagnostic tools Having a run-time environment