2.1 - 2.5 Flashcards

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
Q

How do you generate random values?

A

Random(startingNUM, endNUM)

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

What are the 3 fundamental programming constructs?

A

Sequence
Selection
Iteration

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

What are the two types of Iteration?

A

Count-controlled loops

Condition-controlled loops

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

What are two examples of condition-controlled loops?

A

WHILE loops

DO UNTIL loops

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

What is a FOR loop (count-controlled)?

A

A loop that repeats a set number of times

30
Q

What is WHILE loop?

A

A loop that repeats until a condition is broken.

31
Q

What is a DO UNTIL loop?

A

A loop that repeats until a condition is met.

32
Q

What are four features of maintainable code?

A

Built from many sub programs

Consistent in its naming conventions

Consistent in indentation

Uses comments to explain code

33
Q

What is a local variable?

A

A variable that only exists when the subprogram is executing.

A variable only accessible inside the subprogram

34
Q

What are data structures?

A

Organised collections of items

35
Q

What is an array?

A

A list containing items of the same data type

A list of a fixed length

36
Q

What is SQL SELECT used for?

A

To search and retrieve data

37
Q

What is the structure of SQL Code?

A

SELECT ‘x’ / *
FROM ‘y’
WHERE ‘z’

38
Q

What does a * represent in SQL?

A

All data

39
Q

What is the structure of a 2D array?

A

array Example = [ [First array], [Second array] ]

40
Q

How do you open a file?

A

textFile = open(“x.txt”)

41
Q

How do you write a line on a file?

A

textFile.writeLine(“”)

42
Q

How do you identify the end of a file?

A

textFile.endOfFile()

43
Q

How do you read a file line?

A

textFile.readLine()

44
Q

How do you close a file?

A

textFile.close()

45
Q

How many file lines can you read at a time?

A

ONE

46
Q

What are the two types of testing?

A

Iterative

Terminal

47
Q

What is terminal testing?

A

Testing of the whole program at the end of development

48
Q

What is iterative testing?

A

Testing of modules throughout development

49
Q

What are the two types of errors?

A

Syntax Error

Logic Error

50
Q

What is a syntax error?

A

Not Following the rules of the language.

Code won’t run.

51
Q

What is a logic error?

A

Code doesn’t run as intended.

Code runs, but results are unexpected.

52
Q

What different test data should be used, to test for robustness?

A

normal data

boundary data

invalid data

Erroneous data

53
Q

What is Erroneous data?

A

Completely wrong + incorrect data type

54
Q

What is invalid data?

A

Completely wrong

Correct data type

55
Q

What is authentication?

A

Checking the identity of a user e.g. password checkers

56
Q

What is validation?

A

Enforcing a rule around user input

57
Q

What is disjunction?

A

An OR gate

58
Q

What is negation?

A

A NOT gate

59
Q

What is conjunction?

A

An AND gate

60
Q

What are the advantages of a high level language?

A

Like written English
More readable
Can run on many CPUs

61
Q

What are the disadvantages of a high level language?

A

Slower to execute

62
Q

What are the advantages of a low level language?

A

Easier to optimise

63
Q

What are the disadvantages of a low level language?

A

Specific to particular CPUs

64
Q

What are translators?

A

Programs that convert one programming language to another.

65
Q

What are the two types of low level language?

A

Assembly code

Machine code

66
Q

What do compilers and interpreters do?

A

Convert high-level code to machine code

67
Q

What are the advantages of a compiler?

A

Produces an executable file

No source code needed afterwards

Fast to execute afterwards

68
Q

What are the advantages of an interpreter?

A

Translates an instruction, then executes it

Errors discovered straight away

69
Q

What are the disadvantages of an interpreter?

A

Source code needed to run

70
Q

What are the disadvantages of a compiler?

A

Errors are only shown right at the end

71
Q

List three ways IDEs support programming:

A

Providing an editor

Providing error diagnostic tools

Having a run-time environment