A dog grooming salon uses the code shown to keep a running count of appointments and to display it.
booked = 0
def add_booking(): booked = booked + 1
def show(): print("Booked today:", booked)
add_booking()show()…
Practice IB Computer Science (First Exam 2027) Topic B2.1 Programming Fundamentals with authentic exam-style questions for both SL and HL students. This question bank focuses on the exact syllabus content for B2.1 Programming Fundamentals and mirrors Paper 1, 2 style where relevant.
Get instant solutions, detailed explanations, and build confidence with questions aligned to IB examiner expectations.
A dog grooming salon uses the code shown to keep a running count of appointments and to display it.
booked = 0
def add_booking(): booked = booked + 1
def show(): print("Booked today:", booked)
add_booking()show()…
An aquarium logs tank readings and uses the function shown, which is intended to report the position of the first reading above a safe limit.
def first_unsafe(readings, limit): position = -1 for i in range(len(readings)): if readings[i] > limit: position = i return position…
A cinema concession stand counts how many of its sold items are drinks.
…
A hotel housekeeping system has an intermittent fault. A developer has added print statements after every assignment in the affected function, and the output now runs to several thousand lines.
the use of print statements as the only debugging technique for this fault.
A greenhouse irrigation controller stores each sensor name as a string such as "zone-north-soil". a function that is passed such a name and returns the text before the first hyphen. You must not use any built-in function that splits a string or that returns a substring.