Note AcademyNote Academy

Computer Science · May / June 2023 · Paper 2 HL · Question 15

IBCS

As printed in the paper

The question as text

15. All the unsorted House objects in the database have been copied to a sufficiently large array allHouses. This array is not completely filled with House objects. The array allHouses and all methods in this question are declared in the main program class. All methods can access the array allHouses directly. Consider the following method. public void unknown(String x) { for (int i=0; i<allHouses.length; i++) { if (allHouses[i].getCity().equals(x)) { System.out.println (allHouses[i].getAddress()); } } }

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

Show the answer and mark scheme
  • 15(a)[2]

  • 15(b)[2]

  • 15(c)[1]

  • 15(d)(i)[2]

  • 15(d)(ii)[2]

  • 15(e)[5]

  • 15(f)[7]

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