Practice IB Computer Science (First Exam 2027) Topic B3.2 Fundamentals of OOP for Multiple Classes with authentic exam-style questions for both SL and HL students. This question bank focuses on the exact syllabus content for B3.2 Fundamentals of OOP for Multiple Classes and mirrors Paper 1, 2 style where relevant.
Get instant solutions, detailed explanations, and build confidence with questions aligned to IB examiner expectations.
Case Study: TransportFleet Inc. has a Vehicle class with a startEngine() method that performs basic engine startup. Their Car and Motorcycle subclasses need different starting procedures: cars require fuel pump priming and automatic transmission checks, while motorcycles need kickstand safety checks.
Define what is meant by "method overriding" in object-oriented programming.
Describe the rules and requirements for properly overriding methods in inheritance hierarchies.
Using the TransportFleet case study, explain how method overriding would be implemented for the different starting procedures and what precautions should be taken.
Case Study: RoboticsLab is designing a Robot class that needs movement, sensing, and communication capabilities. They're debating between inheriting from a MovableRobot class versus composing the robot from separate MovementModule, SensorModule, and CommunicationModule objects.
Define what is meant by "composition over inheritance" design principle.
Explain the advantages of using composition instead of inheritance and describe scenarios where composition is preferable.
Using the RoboticsLab case study, compare how this could be implemented using inheritance versus composition and evaluate which approach would be more flexible.