Practice B3 Object-oriented programming with authentic IB Computer Science (First Exam 2027) exam questions for both SL and HL students. This question bank mirrors Paper 1, 2, 3 structure, covering key topics like programming concepts, algorithms, and data structures. Get instant solutions, detailed explanations, and build exam confidence with questions in the style of IB examiners.
Case Study: MathTutor Educational Software is developing a calculator application that needs to handle different types of mathematical operations: addition with two integers, addition with two decimals, and addition with three numbers for advanced calculations.
State what is meant by "method overloading" in object-oriented programming.
Describe the rules that govern method overloading and explain how the compiler determines which overloaded method to call.
Using the MathTutor case study, explain how method overloading would be implemented for the addition operations and why this approach is beneficial.
Case Study: GeometryLibrary is creating a mathematical utilities package with functions like calculateCircleArea(), calculateTriangleArea(), and findMaximum(). These functions don't depend on specific object instances and should be available without creating geometry objects.
Define what is meant by "static methods" in object-oriented programming.
Compare static methods with instance methods in terms of how they are called and what data they can access.
Using the GeometryLibrary case study, justify why the utility functions should be static and explain the advantages of this design choice.
Case Study: GlobalSchool Network is building an educational platform that needs to track the total number of students across all schools in their system. This count must be shared among all Student objects and updated whenever new students enroll or graduate.
Define what is meant by "class attributes" (static variables) in object-oriented programming.
Distinguish between class attributes and instance attributes in terms of memory allocation and sharing among objects.
Using the GlobalSchool case study, explain why a class attribute would be appropriate for tracking total student count and how it would be implemented.
Case Study: ECommercePlatform is developing a ShoppingCart class that directly accesses database tables to retrieve product information, update inventory, and process payments, creating tight dependencies on specific database structures.
Define what is meant by "object coupling" in object-oriented design.
Distinguish between loose coupling and tight coupling, explaining the implications of each for software maintenance.
Using the ECommercePlatform case study, analyse the coupling issues created by direct database access and suggest improvements.
Case Study: An online university is building a student management system to handle enrolments, grades, and academic records. The system needs to manage thousands of students, each with unique information like student ID, name, courses, and GPA.
State what is meant by a "class" in object-oriented programming.
Distinguish between a class and an object, explaining the relationship between them.
Using the university case study, describe what would constitute the Student class definition and what would be examples of objects for this scenario.
Case Study: CorporateStructure Ltd. is modelling their organization where a Department contains Employee objects and Office objects. Employees can work in multiple departments and offices can be shared between departments.
State what is meant by "aggregation" in object-oriented design.
Compare aggregation with composition in terms of object relationships and lifecycle dependencies.
Using the CorporateStructure case study, analyse whether aggregation or composition would be more appropriate for Department-Employee and Department-Office relationships.
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: DesignStudio Pro is creating a drawing application where users can create different shapes (Circle, Rectangle, Triangle) that all need to calculate area and perimeter, but each shape uses different mathematical formulas for these calculations.
State what is meant by "polymorphism" in object-oriented programming.
Compare compile-time polymorphism (method overloading) with runtime polymorphism (method overriding), explaining when each occurs.
Using the DesignStudio case study, describe how polymorphism would allow treating different shapes uniformly while maintaining specific area calculations.
Case Study: SecureBank is developing an online banking application where customer account information must be protected from unauthorized access. Account balances and transaction histories contain sensitive financial data that requires strict security measures.
Define what is meant by "encapsulation" in object-oriented programming.
Explain the benefits of using private and public access modifiers in class design.
Using the SecureBank case study, explain why the account balance should be private and describe what public methods would be necessary to interact with the balance safely.
Case Study: AeronauticsDesign Corp wants to create a FlyingCar class that needs characteristics from both their existing Car class (wheels, steering, land navigation) and Aircraft class (wings, flight controls, air navigation), but their programming language doesn't support multiple inheritance.
Define what is meant by "multiple inheritance" in object-oriented programming.
Explain the diamond problem that can occur with multiple inheritance and describe how different programming languages address this issue.
Using the AeronauticsDesign case study, analyse the challenges this creates and suggest design solutions that avoid multiple inheritance problems.