2.2 - Programming Fundamentals Flashcards

1
Q

What are the three programming constructs?

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

What is sequencing?

A

Structuring code into a logical, sequential order one after the other

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

What is selection?

A

Decision making using if or statements

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

What is iteration?

A

Repeating code using for or while loops

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

What do variables do?

A

Assign a data value (E.G: “Emily”) to an identifier (E.G: First_Name)

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

What is a constant?

A

A variable that doesn’t change whilst the program is running

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

What is a subroutine

A

Named out of line blocks of code that are called in the main program to execute

A sequence of instructions that perform a specific task

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

What are local variables?

A

Variables declared within a specific subroutine that can only be used within that subroutine

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

What are the advantages of using local variables?

A
  • Saves memory
  • Easier to debug local variables
  • You can reuse subroutines with local variables in other programs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are global variables?

A

Variables that can be used at any point within the whole program

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

What are the advantages of using global variables?

A
  • Can be used anywhere in the program
  • Makes maintenance easier
  • Can be used for constants
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the most common arithmetic operators?

A
  • Add (+)
  • Subtract (-)
  • Multiply (*)
  • Divide (/)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is modulo division (AKA modulus)?

A

Reveals the remainder from the last whole number, E.G:
9 MOD 4 = 1 (4 goes into 9 twice (8) with a remainder of 1)

Operator: MOD or %

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

What is integer division (AKA quotient)?

A

Reveals the whole number of times a number can be divided into another number, E.G:
9 DIV = 2 (4 goes into 9 fully, twice)

Operator: DIV or //

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

What are logical operators?

A

TRUE or FALSE values (Boolean), E.G: AND, OR or NOT

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

What is a character?

A

A single character, such as a letter, number or punctuation symbol, E.G:
- T
- 8
- ?

17
Q

What is a string?

A

A sequence of characters that can include letters, numbers and punctuation, E.G:
- Harry Waters
- 14:50pm
- Ice Age 4

18
Q

What is an integer?

A

A whole number, E.G:
- 475
- -8432
- 5

19
Q

What is a real number?

A

A decimal number, E.G:
- 65.3
- -321.1234
- 909.135

20
Q

What is boolean?

A

An answer that only has two possible values, E.G:
- True / False
- Yes / No
- 1 / 0

21
Q

What is casting?

A

Converting the value of a variable from one data type to another

22
Q

What is an array?

A

A list containing items of the same data type

23
Q

What is a two-dimensional array?

A

An array with multiple rows and columns that comes in the form of a table

24
Q

What are records?

A

Lists storing data of different data types

25
Q

What should we always assume indexing starts at?

A

0, unless told otherwise

26
Q

What is SQL (structured query language)?

A

A language that can be used to search for data in a database