Loading...

My Learning Pad Login

Welcome

GCSE OCR Computer Science J277 - Topic 2.2.2: Data Types Exam

Instructions

Questions

Question 1 (2 marks) [Descriptive]

Define what a data type is and explain why it is important in programming.

Question 2 (1 mark) [Objective]

Name the five data types specified in the OCR J277 syllabus.

Question 3 (3 marks) [Objective]

Identify the data type for each of the following values:
a) 42 (1 mark)
b) "Hello" (1 mark)
c) TRUE (1 mark)

Question 4 (2 marks) [Descriptive]

Explain why an integer data type is more appropriate than a string for storing the number of students in a class.

Question 5 (4 marks) [Descriptive]

Write pseudo-code to:

Question 6 (4 marks) [Descriptive]

Write pseudo-code (Python code is also an option) to:

Question 7 (3 marks) [Objective]

What data type would you use for the following, and why?
a) A single letter grade (e.g., 'A'). (1 mark)
b) A person’s height in meters (e.g., 1.75). (1 mark)
c) A flag indicating if a game is over. (1 mark)

Question 8 (5 marks) [Descriptive]

Write pseudo-code for a program that:

Question 9 (3 marks) [Objective]

What is the purpose of type casting in programming? Give an example in Python.

Question 10 (3 marks) [Objective]

What is the output of this Python code? Explain briefly.

x = "10"
y = int(x) * 2
print(y)

Question 11 (4 marks) [Descriptive]

Write pseudo-code (Python code is also an option) to input two numbers as strings, cast them to floats, calculate their average, and output the result.

Question 12 (3 marks) [Objective]

In the following pseudo-code, identify the data type of each variable:

price ← 19.99
quantity ← 5
description ← "Apples"

a) price (1 mark)
b) quantity (1 mark)
c) description (1 mark)

Question 13 (4 marks) [Descriptive]

Write pseudo-code to:

Question 14 (2 marks) [Descriptive]

Explain the difference between a character and a string data type, with examples.

Question 15 (5 marks) [Descriptive]

Write a pseudo-code (Python code is also an option) that:

End of Question Paper