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.
The 20 questions
-
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
-
What is passed to a subroutine when a parameter is passed by reference?
- Copy of data
- Memory address
- Variable name
- Data type
-
What is the main difference between a function and a procedure?
- Functions return values
- Procedures use parameters
- Procedures return values
- Functions accept parameters
-
Which object-oriented concept restricts direct access to an object's internal data?
- Encapsulation
- Inheritance
- Polymorphism
- Instantiation
-
What OOP feature allows a subclass to acquire methods from a parent class?
- Polymorphism
- Encapsulation
- Abstraction
- Inheritance
-
Which term describes methods with the same name behaving differently across different classes?
- Encapsulation
- Polymorphism
- Instantiation
- Inheritance
-
Which special method is automatically executed when a new object is created?
- Setter method
- Constructor
- Getter method
- Destructor
-
Which IDE tool allows a programmer to pause code execution at a specific line?
- Breakpoint
- Variable watch
- Compiler
- Syntax checker
-
Which feature of an IDE editor highlights language keywords in different colours?
- Auto-completion
- Code folding
- Pretty printing
- Syntax highlighting
-
A variable containing 10 is passed by value to a subroutine that doubles it. What is its final value?
- 5
- 20
- 0
- 10
-
A variable containing 10 is passed by reference to a subroutine that doubles it. What is its final value?
- 20
- 10
- 5
- 0
-
What is the process of creating a concrete object from a class definition called?
- Overriding
- Inheritance
- Encapsulation
- Instantiation
-
How should attributes in a class be declared to enforce strict encapsulation?
- Global
- Private
- Static
- Public
-
How does a subclass redefine a method inherited from its parent superclass?
- Method encapsulation
- Method instantiation
- Method overloading
- Method overriding
-
Why are local variables preferred over global variables in modular programming?
- Enables syntax checking
- Prevents unintended side-effects
- Reduces file size
- Increases execution speed
-
Which debugging technique allows a developer to execute code line-by-line to trace logic?
- Refactoring
- Profiling
- Stepping
- Compiling
-
What is a class in object-oriented programming best defined as?
- Blueprint for objects
- Running process
- Executable file
- Instance of object
-
Which IDE feature displays the current values of specific variables as code executes?
- Stack trace
- Watch window
- Breakpoint
- Output window
-
What is a subroutine called that is defined inside an object-oriented class?
- Attribute
- Method
- Interface
- Parameter
-
What term describes defining multiple methods in the same class with identical names but different parameters?
- Method overriding
- Method overloading
- Method recursion
- Method encapsulation
Related quizzes
- Programming constructs, recursion and variable scope Quiz · 2.2.1a · 20 questions
- Problem recognition, decomposition, divide and conquer, abstraction Quiz · 2.2.2a · 20 questions
- Backtracking, data mining, heuristics, performance modelling, pipelining, visualisation Quiz · 2.2.2b · 20 questions
- Processor components: ALU, control unit, registers and buses Quiz · 1.1.1a · 20 questions
- Operating systems and memory management Quiz · 1.2.1a · 20 questions
- Compression, encryption and hashing Quiz · 1.3.1 · 20 questions
- Primitive data types and binary number representation Quiz · 1.4.1a · 20 questions
- Data Protection Act 1998 and Computer Misuse Act 1990 Quiz · 1.5.1a · 20 questions
- The nature and need for abstraction and abstract models Quiz · 2.1.1 · 20 questions
- Algorithm design, suitability, efficiency and Big O notation Quiz · 2.3.1a · 20 questions