Programming Fundamentals (Paper 2) Flashcards

1
Q

What are the three constructs (ideas of programming) ?

A

Sequence, Selection, Iteration
They are used to control the flow of a program.

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

Sequence

A

Structuring code into a logical, sequential order.

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

Selection

A

Decision making using IF statements

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

Iteration

A

Repeating code using FOR or WHILE loops
(Iteration is the process of looping or repeating sections of a program.)

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

What is a constant?

A

constants cannot be altered while the program runs. e.g pi = 3.14159

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

What is a variable?

A

Variables can be altered while the program runs
e.g. x = 45

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

What are the two types of iteration?

A

count - controlled
condition - controlled

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

What does a count-controlled loop do ?

A

Count-controlled loops repeat the same steps a specific number of times, regardless
of the outcome.
(Using count-controlled iteration can lead to fewer programming errors and more flexible programs.)

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

What does a condition-controlled loop do?

A

A condition-controlled loop will keep repeating the steps over and over … and
over … and over … and over, until it gets a specific result.

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

What is it mean to assign a variable (assignment)?

A

Giving a variable a value
e.g. y = 24

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

What is an infinite loop?

A

Condition-controlled loops can be written to continue forever. This is known as an
infinite loop

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

Meaning of nesting?

A

When using
selection, the number of possible paths at a decision point can be increased by including one selection within another.

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

What is it meant by casting?

A

the conversion of one data type into another.
e.g. an integer may need to be continued to a string in order to be displayed as part of a message.
(str(68) returns “68”
int(“54”) returns 54)

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

What is an array?

A

An array is a data structure that can store a collection of data values all under one name.​
E.g games = [“FIFA”,”Fortnite”,”GTA”]

Games is the array

Each piece of data in an array is called an element — each element can be accessed using its position (or index) in the array

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