Lesson 1.2.4a

1.2.4a Programming paradigms, procedural and object-oriented languages Quiz: OCR Computer Science, Unit 2

20 questions

In partnership with Revision Ninja

Lesson 1.2.4a, Programming paradigms, procedural and object-oriented languages: 20 multiple choice questions for the OCR Computer Science (H446), Unit 2: Software and software development, 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 programming paradigm focuses on describing what the computer should achieve rather than how?

    • Declarative
    • Object-oriented
    • Imperative
    • Procedural
  2. Which paradigm organises code into reusable blocks of instructions called procedures and functions?

    • Logic
    • Declarative
    • Functional
    • Procedural
  3. What term describes a blueprint or template used to create objects in object-oriented programming?

    • Class
    • Method
    • Instance
    • Attribute
  4. What is the process of creating an individual object from a class definition called?

    • Instantiation
    • Polymorphism
    • Inheritance
    • Encapsulation
  5. Which OOP concept hides internal object details and restricts direct access to attributes?

    • Polymorphism
    • Encapsulation
    • Inheritance
    • Abstraction
  6. What OOP feature allows a subclass to acquire properties and methods from a superclass?

    • Inheritance
    • Instantiation
    • Polymorphism
    • Encapsulation
  7. Which OOP concept allows methods with the same name to behave differently in different classes?

    • Polymorphism
    • Inheritance
    • Instantiation
    • Encapsulation
  8. What special method is automatically run when a new object is created from a class?

    • Setter
    • Getter
    • Constructor
    • Destructor
  9. An attribute in a class should only be readable via a method. Which access modifier is best?

    • Protected
    • Global
    • Private
    • Public
  10. A Dog class has a breed attribute and a bark action. What is the bark action called?

    • Attribute
    • Method
    • Class
    • Constructor
  11. If Car is a class definition, what is myCar created from it called?

    • Procedure
    • Object
    • Method
    • Attribute
  12. Which type of method specifically retrieves the current value of a private class attribute?

    • Setter
    • Constructor
    • Destructor
    • Getter
  13. A subclass defines a method with identical name and parameters as its superclass. What is this?

    • Data hiding
    • Class instantiation
    • Method overloading
    • Method overriding
  14. Passing a variable where the subroutine receives a copy of its value is called what?

    • Pass by address
    • Pass by pointer
    • Pass by reference
    • Pass by value
  15. Passing a parameter so that modifications inside the subroutine affect the original variable is called what?

    • Pass by value
    • Pass by copy
    • Pass by literal
    • Pass by reference
  16. Which programming paradigm uses mathematical functions and avoids changing state or mutable data?

    • Object-oriented
    • Procedural
    • Imperative
    • Functional
  17. In OOP, what type of relationship exists when a Student class inherits from a Person class?

    • Is-a
    • Part-of
    • Uses-a
    • Has-a
  18. A Car class contains an Engine class object. What type of relationship is this?

    • Polymorphic
    • Inherited
    • Has-a
    • Is-a
  19. Which access modifier allows attribute access within the class and any of its subclasses only?

    • Protected
    • Global
    • Public
    • Private
  20. Which type of method is used to modify the value of a private class attribute?

    • Getter
    • Constructor
    • Destructor
    • Setter

All OCR Computer Science quizzes