Unit 7: B3 Object-oriented programming

Topic 7.1: Object-oriented programming Questions

Practice 20 exam-style questions for IB Computer Science Topic 7.1. Review the question stems below, then unlock the full Question Bank to access markschemes, model answers, and AI grading.

1Construct5 marks
2026
A haulage firm has 10 drivers held in a list called drivers, each a Driver object with the methods year_total() and best_month() and a getter get_id(). Two class-level values, bonusA and bonusB, are paid as follows: bonusA if the year's total distance is over 300000, and bonusB if any single month is over 20000. Construct a Python function pay_bonuses() that, for each driver, works out the total bonus and outputs their id and that bonus.
Markscheme and model answer locked
Unlock Question
2List4 marks
2026
A haulage firm has a Driver class. Its constructor takes a staff id, stores it in a private attribute, and declares an empty collection that will later hold twelve monthly distance totals. List the operations that would be carried out by the constructor when a new Driver object is created.
Markscheme and model answer locked
Unlock Question
3Construct4 marks
2026
A Sailing class holds seatsSold, capacity, basePrice and a bookings array of Booking objects. Construct a Python method add_booking() that takes a name and an email, works out the current fare by calling the existing method updated_fare(), creates the Booking, stores it and keeps the count in step.
Markscheme and model answer locked
Unlock Question
4Construct5 marks
2026
A haulage firm has 10 drivers held in an array called drivers, each a Driver object with the methods yearTotal() and bestMonth() and a getter getId(). Two static values, bonusA and bonusB, are paid as follows: bonusA if the year's total distance is over 300000, and bonusB if any single month is over 20000. Construct a Java method payBonuses() that, for each driver, works out the total bonus and outputs their id and that bonus.
Markscheme and model answer locked
Unlock Question
5Construct4 marks
2026
A Sailing class holds seatsSold, capacity, basePrice and a bookings array of Booking objects. Construct a Java method addBooking() that takes a name and an email, works out the current fare by calling the existing method updatedFare(), creates the Booking, stores it and keeps the count in step.
Markscheme and model answer locked
Unlock Question
6State4 marks
2026
State four members a class may contain.
Markscheme and model answer locked
Unlock Question
7Describe2 marks
2026
Describe what happens to an object's attributes when a second object of the same class is created.
Markscheme and model answer locked
Unlock Question
8Describe3 marks
2026
Describe the difference between an instance method and a static method.
Markscheme and model answer locked
Unlock Question
9Outline3 marks
2026
Outline the lifetime of an object.
Markscheme and model answer locked
Unlock Question
10Identify1 mark
2026
A delivery program declares: class Truck(Vehicle): Identify the OOP feature that this class header shows.
Markscheme and model answer locked
Unlock Question
11Describe2 marks
2026
A drawing program has a Shape class with Circle and Square subclasses. Describe one benefit of inheritance in this program.
Markscheme and model answer locked
Unlock Question
12Identify2 marks
2026
A shop's stock program already uses encapsulation. Identify two other features of object-oriented programming.
Markscheme and model answer locked
Unlock Question
13Outline2 marks
2026
A hotel's Room class has a boolean attribute seaView. The hotel adds a third option, rooms with a garden view. Outline one change needed to the variable seaView.
Markscheme and model answer locked
Unlock Question
14Choose1 mark
2026
Choose what a constructor does.
Markscheme and model answer locked
Unlock Question
15Choose1 mark
2026
Choose what happens when one object reference is assigned to another variable.
Markscheme and model answer locked
Unlock Question
16Choose1 mark
2026
Choose the principle that lets different classes respond to the same call in their own way.
Markscheme and model answer locked
Unlock Question
17Define1 mark
2026
Define object-oriented programming.
Markscheme and model answer locked
Unlock Question
18Determine3 marks
2026
Determine the methods a Seat class in a cinema system should offer.
Markscheme and model answer locked
Unlock Question
19Explain4 marks
2026
Explain why a well-designed interface makes a class easier to change.
Markscheme and model answer locked
Unlock Question
20Determine3 marks
2026
Determine whether a Car and an Engine should be related by inheritance or association, and justify your answer.
Markscheme and model answer locked
Unlock Question

Ready to practice Topic 7.1?

Get instant AI feedback on your answers, view detailed markschemes, and track your progress across all IB Computer Science topics.

Start Practising Now