Note AcademyNote Academy

Computer Science · May / June 2025 · Paper 2 TZ2 HL · Question 17

IBCS

As printed in the paper

The question as text

17. The Supplier class gives the details of suppliers. The following shows part of the code for this class: import java.util.LinkedList; public class Supplier { private String supplierName; private String supplierCountry; private String[] productNames = new String[10]; public Supplier(String supplierName, String supplierCountry, String[] productNames) { this.supplierName = supplierName; this.supplierCountry = supplierCountry; this.productNames = productNames; } public String getSupplierName(){ return supplierName; } public String getSupplierCountry(){ return supplierCountry; } // all accessor and mutator methods are present but not shown public String displayData() { System.out.println("Supplier: " + supplierName + ", Country: " + supplierCountry); } } // end of Supplier class The SupplierManager class has methods to generate the information required. The following shows part of the code for this class: public class SupplierManager { LinkedList<Supplier> supplierList; public SupplierManager() { supplierList = new LinkedList<>(); } public void addSupplier(Supplier newSupplier) { // code missing } public void displayList() { // code missing } public static int countOfSuppliers(LinkedList<Supplier> supplierList, String country, int n) { // code missing } } // end of SupplierManager class (Option D continues on the following page) (Option D, question 17 continued)

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

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

  • 17(a)(ii)[2]

  • 17(b)[3]

  • 17(c)(i)[2]

  • 17(c)(ii)[5]

  • 17(c)(iii)[4]

  • 17(d)[2]

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