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.

Host this setFree Play

The 20 questions

  1. Which data type represents a whole number?

    • Real
    • String
    • Integer
    • Boolean
  2. Which data type represents a number with a fractional part?

    • Char
    • Integer
    • Boolean
    • Real
  3. What values can a Boolean data type hold?

    • Decimal numbers
    • True or false
    • Text characters
    • Any whole number
  4. Which data type holds a single alphanumeric symbol?

    • Character
    • Real
    • String
    • Integer
  5. Which data type stores a sequence of characters?

    • Character
    • String
    • Integer
    • Boolean
  6. What is the primary purpose of casting in programming?

    • Deleting stored variables
    • Changing data types
    • Encrypting secure text
    • Compressing file sizes
  7. Which data type is most suitable for storing a person's age in whole years?

    • String
    • Boolean
    • Integer
    • Real
  8. Which data type is most suitable for storing a price such as 3.50?

    • Real
    • Character
    • Boolean
    • Integer
  9. A string '42' is cast to an integer and then added to 8. What is the result?

    • Error
    • 50
    • 428
    • 42
  10. Which data type should store whether a user has logged in?

    • Real
    • Integer
    • Boolean
    • String
  11. A program divides 7 by 2 using real numbers. What value is stored?

    • 4
    • 3.5
    • 3
    • 2
  12. 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
  13. Which data type is most suitable for a stock count that is never negative or fractional?

    • Integer
    • Boolean
    • Real
    • Character
  14. Which data type is most suitable for storing whether a light is on or off?

    • String
    • Boolean
    • Real
    • Integer
  15. Which operation causes a type mismatch error without casting?

    • Comparing two integers
    • Printing boolean flags
    • Reading file contents
    • Adding text numbers
  16. 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
  17. When is a temporary data type cast most useful?

    • When compiling code
    • During file deletion
    • During mixed calculations
    • When declaring constants
  18. 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
  19. Which data types are best for a name, age and pass flag?

    • Boolean, char, real
    • Integer, real, string
    • String, real, integer
    • String, integer, Boolean
  20. A user's name is stored in a program. Which data type is most suitable?

    • Boolean
    • Integer
    • String
    • Real

All OCR Computer Science quizzes