Topic 1 Computational Thinking and Topic 6 Problem Solving Flashcards

1.1 (9-12 & 14), 1.2 (18-23), 1.3 (24-28), 1.4 (35), 1.8 (105)

1
Q

Define a “syntax error”

This is a category of error.

A

An error in the use of the programming language.

e.g a missing ‘:’ or a misspelled keyword

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

Define a runtime error.

This is a category of error.

A

An error which causes a program to crash.

e.g ‘divide by sero’ and ‘index out of range’

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

Define a logic error.

A

An eror which causes incorrect or unwanted behaviour(s).

e.g using the wrong arithmetic operator or mixing up variable names.

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

What is syntax?

A

The rules that govern how the pieces of a programming language can be put together to make meaningful instructions

Similar to grammar and punctuation in english.

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

What is IDE?

A

It is a package that helps programmers to develop program code.

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

What is a reserved word?

A

Any keyword in the programming language that programmers aren’t allowed to change.

^ So use for variables etc.

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

What is a comment?

A

A way for programmers to annotate code so their logic is clear to the reader. Comments aren’t executed.

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

What is a literal?

A

Values in code, such as numbers or characteristics inside quotes. They can’t be changed during execution.

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

What is a variable?

A

A name associated with containers which programmers use to hold data. Their contents can be changed during execution.

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

What is a program?

A

An algorithm which has been converted into program code to be executed.

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

What is program code?

A

The implementation of an algorithm in a human-readable form that can be translated into a form to execute on a computer.

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

Define ‘debugging’.

A

The process by which a programmer finds and corrects errors in code.

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

What does IDE stand for?

A

Integrated Development Environment.

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

What is carriage return?

A

The character generated inside the computer when a user presses the Enter key on the keyboard.

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

What is a console?

A

The place where the output from a program is displayed.

This could be directly on a device or in a window of another app, such as IDE.

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

What is a high level language?

A

A programming language resembling human language.

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

What is a low level language?

A

A programming language that is closer to machine code than human language and requires a detailed knowledge of a particular CPU’s architecture to write.

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

What is a type error?

A

An error that occurs when an operation is attempted that is invalid for that type of data.

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

What is a name error?

A

An error that occurs when a name is used that is not known about (often a misspelt variable name.)

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

What is a zero division error?

A

An error that occurs when you attempt to divide a number by zero.

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

Define ‘keyboard interrupt’.

A

When a program is interrupted by the keyboard when pressing control+c

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

Who was the creator of boolean?

A

George Boole.

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

What is decomposition?

A

The breakdown of a problem into smaller, more manageable parts, which are then easier to solve.

24
Q

What is abstraction?

A

The loss of detail until you end up with the essential features of something so we can understand what people are trying to communicate.

25
The higher level of abstraction...
The less detail required.
26
What is an algorithm?
A precise method for solving a problem consisting of a sequence of step-by-step instructions that solve a specific problem.
27
What decides a successful algorithm?
- Accuracy - Consistency - Efficiency
28
Define 'execution'.
The process by which a computer carries out the instructions of a program.
29
What does a flowchart do? | In the context of 1.2 algorithms and programs.
Represents an algorithm graphically.
30
Describe the steps that help produce programs that execute on a computer.
- Analyse (understand the problem and how to solve it) - Design (develop a solution in the form of an algorithm) - Implement (translate the description of the solution into a programming language) - Debug and test - Evaluate (make judgements on the solution and consider changes in favour of efficiency)
31
Define 'arithmetic operator'.
A symbol used to perform a calculation on two numbers.
32
What are the 7 arithmetic operators? | and what do they do?
- **+** (addition) - **-** (subtraction) - **\*** (multiplication) - **/** (division (including decimal places)) - **//** (integer division (ignoring remainders)) - **%** (modulus (divides and returns remainder) - **\*\*** (exponentiation (raise the first value to the power of the second value))
33
What is camel case?
Creating a variable name which has no space between words and has the second word starting with a capital letter.
34
# Which of these variable names are valid? 1. 8HouseNumber = 288 2. houseNumber = 288 3. house Number = 288 4. house_number = 288 5. import = 288
1. INVALID - begins with a number 2. valid 3. INVALID - includes a spcae 4. valid 5. INVALID - 'import' is a reserved word within python
35
What are the 5 data types? | and their python keywords
- Integer (int) - Real (float) - Boolean (bool) - Character (str) - String (str)
36
What does an integer do?
Stores whole numbers without a fractional part (decimal place).
37
What does a real do?
Stores whole numbers with a fractional part (decimal place).
38
Describe 'boolean'.
Only has two possible values: true or false.
39
What does a character do?
Stores a single character or symbol.
40
What is a string?
A sequence of one or more characters or symbols.
41
When writing strings and using characters in code, you must enclose it in...
Quotation marks. | In python, strings and characters are treated the same way.
42
Define 'declaration'.
This happens when a variable is named and the computer allocates it a location in its memory. The amount of memory varies based on the data type.
43
Define 'initialisation'.
The assigning of the very first value to a variable.
44
Define 'function'.
A subprogram that performs a specific task and can be used at any point in the program. High-level programming languages have many useful built in functions but you can also create your own.
45
What does the type() function do in python?
Determines the data type of a variable.
46
What is a type conversion?
A temporary change of data type of an operation or instruction which allows it to be performed.
47
Name the 2 ways a type conversion can take place.
- Coercion An operation or instruction requires a change of data type and this is done automatically - Conversion Written code written by *you* which explicitly causes a change of data type. ## Footnote Conversion can use: 'int()', 'str()', 'float()', 'bool()', 'list()'
48
State the names and symbols of the 6 relational operators.
- Equal to: == - Not equal to: != - Greater: > - Greater than or equal to: >= - Less than: < - Less than or equal to: <= | Remember these !!!
49
What is a relational operator?
Symbols that are used to compare two values.
50
51
What is a logic gate?
The basic component of digital circuits, taking one or two inputs and producing a single output based on a rule
52
What is a truth table?
Table showing all possible combinations of the inputs & outputs of an operator.
53
What are the 3 main logic gates?
NOT, AND & OR ## Footnote NOT -> Output is opposite of input AND -> Outputs 1 only if all inputs are 1 OR -> Outputs 1 if any of the inputs are 1
54
54
Match the symbol to the operator. ▷ ◗ 🌛 | I'm not giving you the operators. Figure it out.
▷ - NOT ◗ - AND 🌛- OR
55
Fill in the truth table: _A|B|A OR B| NOT (output)_ 0|0|............|1 0|.. |.....1.....|0 ..|0|............|0 ..|..|............|0
You should've gotten... _A|B|A OR B| NOT (output)_ 0|0|......0.....|1 0|1|......1.....|0 1|0|......1.....|0 1|1|......1.....|0
56
How do you calculate the amount of variations in a table?
amnt. of possible valuesamnt. of variables ## Footnote For example if there are 2 possible values and there are 5 variables, the amount of options is 25