Define what a variable and a constant are in programming.
What symbol is used for assignment in OCR pseudo-code?
Give an example of:
a) An input statement in pseudo-code. (1 mark)
b) An output statement in pseudo-code. (1 mark)
c) Assigning a value to a variable in pseudo-code. (1 mark)
Explain the three basic programming constructs: sequence, selection, and iteration.
Write pseudo-code for a sequence that calculates the sum of two numbers (x = 7, y = 3) and outputs the result.
Write pseudo-code using selection to check if a user's age (input) is 18 or over. If yes, output "Adult"; else, "Minor".
Write a count-controlled loop in pseudo-code to output numbers from 1 to 5.
Write a condition-controlled loop in pseudo-code that starts with counter = 0 and outputs the counter while it's less than 10, incrementing by 2 each time.
Identify the type of each operator (arithmetic, comparison, or Boolean) and explain its function:
a) % (MOD)
b) >=
c) AND
Write a Python example using arithmetic operators to calculate (5 + 3) * 2 / 4 and print the result.
What is the output of this pseudo-code?
a ← 10
b ← 3
IF a MOD b == 1 THEN
OUTPUT("Remainder 1")
ELSE
OUTPUT("Other")
ENDIF
Write pseudo-code for a program that:
Explain the difference between count-controlled and condition-controlled iteration.
Using Boolean operators, write a pseudo-code condition to check if a score is between 50 and 100 (inclusive).
What would be the output of this Python code? Explain briefly.
num = 5
while num > 0:
print(num)
num -= 1