The symbol is ←.
a) name ← INPUT("Enter name: ") (1 mark)
b) OUTPUT("Hello") (1 mark)
c) score ← 0 (1 mark)
x ← 7
y ← 3
sum ← x + y
OUTPUT(sum)
(1 mark for assignments, 1 for calculation, 1 for output, 1 for correct sequence.)
age ← INPUT("Enter age: ")
IF age >= 18 THEN
OUTPUT("Adult")
ELSE
OUTPUT("Minor")
ENDIF
(1 mark for input, 1 for IF, 1 for condition, 1 for outputs, 1 for ELSE/ENDIF.)
FOR i ← 1 TO 5
OUTPUT(i)
NEXT i
(1 mark for FOR, 1 for range, 1 for OUTPUT, 1 for NEXT.)
counter ← 0
WHILE counter < 10 DO
OUTPUT(counter)
counter ← counter + 2
ENDWHILE
(1 mark for initialization, 1 for WHILE, 1 for condition, 1 for OUTPUT/increment, 1 for ENDWHILE.)
a) Arithmetic: Returns the remainder of division. (1 mark)
b) Comparison: Greater than or equal to. (1 mark)
c) Boolean: True if both conditions are true. (1 mark)
result = (5 + 3) * 2 / 4
print(result) # Outputs 4.0
(1 mark for expression, 1 for parentheses, 1 for print, 1 for correct output in comment/explanation.)
Explanation: Addition first (8), multiply by 2 (16), divide by 4 (4.0).
"Remainder 1"
Explanation: 10 MOD 3 = 1 (remainder), so condition is true. (2 marks for explanation, 1 for output.)
num ← INPUT("Enter number: ")
IF num MOD 2 == 0 THEN
OUTPUT("Even")
ELSE
OUTPUT("Odd")
ENDIF
FOR i ← 1 TO 3
OUTPUT("Check complete")
NEXT i
(1 mark for input, 1 for IF/MOD, 1 for outputs, 1 for FOR loop, 1 for overall structure.)
IF score >= 50 AND score <= 100 THEN
(1 mark for >=, 1 for <=, 1 for AND, 1 for structure.)
Explanation: AND ensures both conditions must be true for the range.
Output:
5
4
3
2
1
Explanation: Loop prints num while >0, decrementing by 1 each time. (2 marks for output, 1 for explanation.)