Computer Science · Oct / Nov 2021 · Paper 1 SL · Question 11
Adapt for 2027Writing functions and processing arrays is taught, but answers must be in Python or Java rather than IB pseudocode.
IBCS
As printed in the paper
The question as text
11. A bus company provides services within a city. The basic fare depends on the travel distance between the departure station and the destination station. The cost per kilometre is € 0.20. Children under the age of 5 can travel for free. Children between the ages of 5 and 15 inclusive can travel with a child age ticket, which gives a 50 % discount off the kilometre fare. The senior discount (age 65+) offers 30 % off the kilometre fare. The sub-program costperkm(AGE) accepts an integer AGE (the age of a passenger), then calculates and returns the cost per kilometre. For example, costperkm(10) returns 0.1, costperkm(20) returns 0.2, costperkm(80) returns 0.14
Read automatically from the paper; the printed page above is exact.
Show the answer and mark scheme
11(a)[4]
11(b)[1]
11(c)[1]
11(d)[3]
11(e)[6]
Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.

