Back to marketplace

2.2 Programming Fundamentals

No description yet. This curated deck is ready for daily study.

Total cards: 24•Content version: v4•Public deck•Updated: 8/1/2026

Card preview (24)

#1
Front (Question)

Define variable

Back (Answer)

A value stored in memory that can change while the program is running

#2
Front (Question)

Define constant

Back (Answer)

A value that does not change while the program is running, and is assigned when the program is designed

#3
Front (Question)

Define assignment

Back (Answer)

Giving a variable or constant a value

#4
Front (Question)

Define casting

Back (Answer)

Converting a variable from one data type to another

#5
Front (Question)

Define input

Back (Answer)

A value is read from an input device e.g. keyboard

#6
Front (Question)

Define output

Back (Answer)

Data generated by the computer and displayed to the user

#7
Front (Question)

Advantages of constants

Back (Answer)

1) make a program easier to read as they are declared and assigned at the top of the program 2) can be changed easily by the programmer in one place in a program 3) instead of changing every instance of a value throughout a program 4) so less chance of errors 5) compiler can optimise code 6) which makes a program run more quickly

#8
Front (Question)

Why is casting needed?

Back (Answer)

Inputs from the keyboard are always characters (multiple characters are called strings). However, for calculations, the ALU must use numbers so the string is cast to a number.

#9
Front (Question)

What is sequence?

Back (Answer)

Executing one instruction after another

#10
Front (Question)

What is selection?

Back (Answer)

A program branching depending on a condition

#11
Front (Question)

What is iteration?

Back (Answer)

Repeating sections of code

#12
Front (Question)

When are FOR loops used?

Back (Answer)

Count-controlled loops. Used when the number of iterations needed is known ahead of the iteration executing.

#13
Front (Question)

When are WHILE loops used?

Back (Answer)

Condition-controlled loops. Used when the number of iterations is not known because the variable used to determine when the iteration ends is changing within the iteration itself

#14
Front (Question)

When are DO…UNTIL loops used?

Back (Answer)

An alternative to WHILE where the code executes at least once before the condition is checked

#15
Front (Question)

Casting to an integer

Back (Answer)

int()

#16
Front (Question)

Casting to a real/float

Back (Answer)

real()/float()

#17
Front (Question)

Casting to boolean

Back (Answer)

bool()

#18
Front (Question)

Casting to a string

Back (Answer)

str()

#19
Front (Question)

Casting to ASCII

Back (Answer)

ASC(b)

#20
Front (Question)

Casting to a character

Back (Answer)

CHR(98)

#21
Front (Question)

Example of a FOR loop

Back (Answer)

for rolls in range():

#22
Front (Question)

Example of a WHILE loop

Back (Answer)

while answer != “Computer”: answer = input(“Pass: “) endwhile

#23
Front (Question)

Example of a DO…UNTIL loop

Back (Answer)

do answer = input(“Pass: “) until answer == “Computer”

#24
Front (Question)

Example of NOT

Back (Answer)

end_of_file = False while not end_of_file