Practice IB Computer Science (First Exam 2027) Topic B3 Object-oriented Programming with authentic exam-style questions for both SL and HL students. This question bank focuses on the exact syllabus content for B3 Object-oriented Programming 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: CAD-Design Pro is developing architectural software where the Rectangle class needs different area calculation methods: one using length and width parameters, and another using coordinate points of opposite corners for complex floor plans.
State what is meant by "method signature" in object-oriented programming.
Describe the components that make up a method signature and explain why method signatures must be unique within a class.
Using the CAD-Design case study, explain how different method signatures would allow the Rectangle class to calculate area using different input parameters.
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.