Note AcademyNote Academy

Computer Science · Oct / Nov 2017 · Paper 2 SL · Question 11

IBCS

As printed in the paper

The question as text

11. The global variable tables is declared as follows: Payment[] tables = new Payment[50]; The indices in this array represent the table number, so tables[1] is a Payment object for the customers occupying table number 1. The driver (main) class contains the following code. Note: You can assume that all appropriate accessor and mutator methods have been included in their respective classes. tables[1] = new Payment(); tables[2] = new Payment(); FoodItem a = new FoodItem("f102", 2); FoodItem b = new FoodItem("f100", 1); DrinkItem c = new DrinkItem("d102", 3); tables[1].addFoodItem(a); tables[1].addFoodItem(b); tables[2].addDrinkItem(c); tables[2].addDrinkItem(new DrinkItem("d103",1)); System.out.println(tables[1].getFiCount()); System.out.println(Payment.getFoodTax()); System.out.println(tables[2].getDi(1).getItemCode());

Read automatically from the paper; the printed page above is exact.

Show the answer and mark scheme
  • 11(a)[3]

  • 11(b)(i)[1]

  • 11(b)(ii)[1]

  • 11(c)[6]

  • 11(d)[7]

Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.