Loading...

My Learning Pad Login

Welcome

GCSE OCR Computer Science J277 - Topic 2.2.1: Programming Fundamentals Exam

Instructions

Questions

Question 1 (2 marks) [Descriptive]

Define what a variable and a constant are in programming.

Question 2 (1 mark) [Objective]

What symbol is used for assignment in OCR pseudo-code?

Question 3 (3 marks) [Descriptive]

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)

Question 4 (2 marks) [Descriptive]

Explain the three basic programming constructs: sequence, selection, and iteration.

Question 5 (4 marks) [Descriptive]

Write pseudo-code for a sequence that calculates the sum of two numbers (x = 7, y = 3) and outputs the result.

Question 6 (5 marks) [Descriptive]

Write pseudo-code using selection to check if a user's age (input) is 18 or over. If yes, output "Adult"; else, "Minor".

Question 7 (4 marks) [Descriptive]

Write a count-controlled loop in pseudo-code to output numbers from 1 to 5.

Question 8 (5 marks) [Descriptive]

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.

Question 9 (3 marks) [Objective]

Identify the type of each operator (arithmetic, comparison, or Boolean) and explain its function:
a) % (MOD)
b) >=
c) AND

Question 10 (4 marks) [Descriptive]

Write a Python example using arithmetic operators to calculate (5 + 3) * 2 / 4 and print the result.

Question 11 (3 marks) [Objective]

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  

Question 12 (5 marks) [Descriptive]

Write pseudo-code for a program that:

Question 13 (2 marks) [Descriptive]

Explain the difference between count-controlled and condition-controlled iteration.

Question 14 (4 marks) [Descriptive]

Using Boolean operators, write a pseudo-code condition to check if a score is between 50 and 100 (inclusive).

Question 15 (3 marks) [Objective]

What would be the output of this Python code? Explain briefly.

num = 5  
while num > 0:  
    print(num)  
    num -= 1  

End of Question Paper