Lesson 2.2.2
2.2.2 Data types Quiz: OCR Computer Science, Unit 8
20 questions
In partnership with Revision Ninja
Lesson 2.2.2, Data types: 20 multiple choice questions for the OCR GCSE Computer Science (J277), Unit 8: Programming fundamentals, written with Revision Ninja.
Host it live on the board and students join with a game code on their own devices, or revise alone with Free Play. The answers are revealed in the game.
The 20 questions
-
Which data type represents a whole number?
- Real
- String
- Integer
- Boolean
-
Which data type represents a number with a fractional part?
- Char
- Integer
- Boolean
- Real
-
What values can a Boolean data type hold?
- Decimal numbers
- True or false
- Text characters
- Any whole number
-
Which data type holds a single alphanumeric symbol?
- Character
- Real
- String
- Integer
-
Which data type stores a sequence of characters?
- Character
- String
- Integer
- Boolean
-
What is the primary purpose of casting in programming?
- Deleting stored variables
- Changing data types
- Encrypting secure text
- Compressing file sizes
-
Which data type is most suitable for storing a person's age in whole years?
- String
- Boolean
- Integer
- Real
-
Which data type is most suitable for storing a price such as 3.50?
- Real
- Character
- Boolean
- Integer
-
A string '42' is cast to an integer and then added to 8. What is the result?
- Error
- 50
- 428
- 42
-
Which data type should store whether a user has logged in?
- Real
- Integer
- Boolean
- String
-
A program divides 7 by 2 using real numbers. What value is stored?
- 4
- 3.5
- 3
- 2
-
What must be done to use a character variable holding '7' in arithmetic?
- Slice the string
- Cast to integer
- Compress the byte
- Convert to boolean
-
Which data type is most suitable for a stock count that is never negative or fractional?
- Integer
- Boolean
- Real
- Character
-
Which data type is most suitable for storing whether a light is on or off?
- String
- Boolean
- Real
- Integer
-
Which operation causes a type mismatch error without casting?
- Comparing two integers
- Printing boolean flags
- Reading file contents
- Adding text numbers
-
Why is a UK postcode usually stored as a string instead of an integer?
- Enables arithmetic operations
- Preserves leading zeros
- Increases processing speed
- Reduces memory usage
-
When is a temporary data type cast most useful?
- When compiling code
- During file deletion
- During mixed calculations
- When declaring constants
-
Why can repeated addition of 0.1 in real variables cause tiny errors?
- Binary rounding limits
- Memory buffer overflow
- Integer overflow limits
- Syntax parsing faults
-
Which data types are best for a name, age and pass flag?
- Boolean, char, real
- Integer, real, string
- String, real, integer
- String, integer, Boolean
-
A user's name is stored in a program. Which data type is most suitable?
- Boolean
- Integer
- String
- Real
Related quizzes
- Programming fundamentals Quiz · 2.2.1 · 20 questions
- Additional programming techniques Quiz · 2.2.3 · 20 questions
- Architecture of the CPU Quiz · 1.1.1 · 20 questions
- Primary storage (memory) Quiz · 1.2.1 · 20 questions
- Networks and topologies Quiz · 1.3.1 · 20 questions
- Threats to computer systems and networks Quiz · 1.4.1 · 20 questions
- Operating systems Quiz · 1.5.1 · 20 questions
- Ethical, legal, cultural and environmental impact Quiz · 1.6.1 · 20 questions
- Computational thinking Quiz · 2.1.1 · 20 questions
- Defensive design Quiz · 2.3.1 · 20 questions