Lesson 2.2.1b

2.2.1b Modularity, parameter passing, IDEs and object-oriented techniques Quiz: OCR Computer Science, Unit 7

20 questions

In partnership with Revision Ninja

Lesson 2.2.1b, Modularity, parameter passing, IDEs and object-oriented techniques: 20 multiple choice questions for the OCR Computer Science (H446), Unit 7: Problem solving and programming, 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. What happens to the original argument when a parameter is passed by value?

    • It is deleted
    • It is overwritten
    • Throws an error
    • It remains unchanged
  2. What is passed to a subroutine when a parameter is passed by reference?

    • Copy of data
    • Memory address
    • Variable name
    • Data type
  3. What is the main difference between a function and a procedure?

    • Functions return values
    • Procedures use parameters
    • Procedures return values
    • Functions accept parameters
  4. Which object-oriented concept restricts direct access to an object's internal data?

    • Encapsulation
    • Inheritance
    • Polymorphism
    • Instantiation
  5. What OOP feature allows a subclass to acquire methods from a parent class?

    • Polymorphism
    • Encapsulation
    • Abstraction
    • Inheritance
  6. Which term describes methods with the same name behaving differently across different classes?

    • Encapsulation
    • Polymorphism
    • Instantiation
    • Inheritance
  7. Which special method is automatically executed when a new object is created?

    • Setter method
    • Constructor
    • Getter method
    • Destructor
  8. Which IDE tool allows a programmer to pause code execution at a specific line?

    • Breakpoint
    • Variable watch
    • Compiler
    • Syntax checker
  9. Which feature of an IDE editor highlights language keywords in different colours?

    • Auto-completion
    • Code folding
    • Pretty printing
    • Syntax highlighting
  10. A variable containing 10 is passed by value to a subroutine that doubles it. What is its final value?

    • 5
    • 20
    • 0
    • 10
  11. A variable containing 10 is passed by reference to a subroutine that doubles it. What is its final value?

    • 20
    • 10
    • 5
    • 0
  12. What is the process of creating a concrete object from a class definition called?

    • Overriding
    • Inheritance
    • Encapsulation
    • Instantiation
  13. How should attributes in a class be declared to enforce strict encapsulation?

    • Global
    • Private
    • Static
    • Public
  14. How does a subclass redefine a method inherited from its parent superclass?

    • Method encapsulation
    • Method instantiation
    • Method overloading
    • Method overriding
  15. Why are local variables preferred over global variables in modular programming?

    • Enables syntax checking
    • Prevents unintended side-effects
    • Reduces file size
    • Increases execution speed
  16. Which debugging technique allows a developer to execute code line-by-line to trace logic?

    • Refactoring
    • Profiling
    • Stepping
    • Compiling
  17. What is a class in object-oriented programming best defined as?

    • Blueprint for objects
    • Running process
    • Executable file
    • Instance of object
  18. Which IDE feature displays the current values of specific variables as code executes?

    • Stack trace
    • Watch window
    • Breakpoint
    • Output window
  19. What is a subroutine called that is defined inside an object-oriented class?

    • Attribute
    • Method
    • Interface
    • Parameter
  20. What term describes defining multiple methods in the same class with identical names but different parameters?

    • Method overriding
    • Method overloading
    • Method recursion
    • Method encapsulation

All OCR Computer Science quizzes