Note AcademyNote Academy

Computer Science · Oct / Nov 2025 · Paper 2 SL · Question 10

IBCS

As printed in the paper

The question as text

10. A law firm has 20 lawyers. They can be categorized into three groups: civil lawyers, criminal lawyers, and company lawyers. A lawyer can have a maximum of 15 cases at a time. The following shows part of the code for the Lawyer class, which keeps details of a lawyer: public class Lawyer { private int lawyerID; // id of the lawyer private String lawyerName; private String lawyerType; // category of lawyer private int lawyerRank; // 0 or 1, default is 0 private int casesWon; // total number of cases won by the lawyer private Case lawyerCases[] = new Case[15]; // lawyer’s array of cases public Lawyer(int lawyerID, String lawyerName, String lawyerType, Case[] lawyerCases) { this.lawyerID = lawyerID; this.lawyerName = lawyerName; this.lawyerType = lawyerType; this.lawyerRank = 0; this.casesWon = 0; this.lawyerCases = lawyerCases; } public String getlawyerName() { return lawyerName; } public String getlawyerType() { return lawyerType; } public int getlawyerRank() { return lawyerRank; } public void setlawyerRank(int lawyerRank) { this.lawyerRank = lawyerRank; } // all accessor and mutator methods are present but not shown } // end of Lawyer class (Option D continues on the following page) (Option D, question 10 continued) The following shows part of the code for the Case class, which keeps details of a case: public class Case { private int caseId; // unique id of the case private String caseClient; // name of the client private String caseTitle; // e.g. 'property dispute', 'tax evasion' etc private int daysFromStart; // number of days elapsed from start of case private char judgmentGiven; // 'N'=no, 'F'=favorable, 'A'=against private String caseStatus; // open/ won/ lost public Case(int caseID, String caseClient, String casesTitle) { this.caseId = caseId; this.caseClient = caseClient; this.casesTitle = casesTitle; this.daysFromStart = 0; this.judgmentGiven = 'N'; this.caseStatus = "open"; } public void setCaseStatus(String caseStatus) { this.caseStatus = caseStatus; } // all accessor and mutator methods are present but not shown public void changeCaseStatus(char judgmentGiven) { /*Code missing*/ } } // end of Case class (Option D continues on the following page) (Option D, question 10 continued) The LawFirmManagement class has a main method and other methods to generate the information required. The following shows part of the code for the LawFirmManagement class: public class LawFirmManagement { private static Lawyer[] allLawyers = new Lawyer[20]; // array of lawyers private static TraineeLawyer[] allTrainees = new TraineeLawyer[30]; // array of lawyer trainees public static void main(String []args) { /*Code missing*/ } public static void displayLawyerNames() { /*Code missing*/ } public static void updateLawyerRank(int[][]casesWon) { /*Code missing*/ } } // end of LawFirmManagement class

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

Show the answer and mark scheme
  • 10(a)[1]

  • 10(b)[2]

  • 10(c)[4]

  • 10(d)(i)[1]

  • 10(d)(ii)[2]

  • 10(d)(iii)[5]

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