Computer Science · May / June 2016 · Paper 2 HL · Question 15
IBCS
As printed in the paper
The question as text
15. The hotel accepts group bookings where many clients, such as tour groups, can be allocated rooms on arrival. The Group class contains the name of the group, the number of rooms used by the group and a method bill() that calculates the total bill for the group. Part of the Group class is shown below. public class Group { private String name; // name of group private int number; // number of rooms allocated to the group public Group(String name, int number) { this.name = name; this.number = number; } public String getName() {return name;} public int getNumber() {return number;} int[] gRooms = new int[number]; // array to hold room numbers allocated to the group public double bill(int[] gRooms) {... // method that calculates the bill for the group } } The GClient class represents a client who is part of a group. It inherits all the class members of the Client class and also stores the name of the group.
Read automatically from the paper; the printed page above is exact.
Show the answer and mark scheme
15(a)[7]
15(b)[6]
15(c)[5]
Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.

