Note AcademyNote Academy

Computer Science · May / June 2025 · Paper 2 TZ3 SL · Question 10

Adapt for 2027Instantiation, private, UML and modularity are taught; the aggregation relationship is from the Higher Level multiple-classes topic. Includes Higher Level only content, which Standard Level students do not study.

IBCS

As printed in the paper

The question as text

10. An art shop sells the work of several artists. Each artist has many artworks for sale. A system is designed to manage artworks, sales and customers. The following shows part of the code for the two classes, Artist and Artwork: public class Artist { private String artistName; // name of the artist private String artistLocation; // current location of the artist private int noOfArtworks; // number of works of art the artist has // stored in the array theArtworks private Artwork [] theArtworks; // details of the works of art produced // by the artist public Artist(String artistName, String artistLocation){ this.artistName = artistName; this.artistLocation = artistLocation; noOfArtworks = 0; theArtworks = new Artwork [100]; // an artist has a maximum of 100 // artworks } public String getName() { return artistName; } public String getLocation() { return artistLocation; } public Artwork getArtwork(int x) { return theArtworks[x]; } public void addArtwork(Artwork x) { theArtworks[noOfArtworks] = x; noOfArtworks = noOfArtworks + 1; } public double commissionToPay() { // code missing } public Artwork[] sortArt() { // code missing } } // end of class Artist (Option D continues on the following page) (Option D, question 10 continued) public class Artwork { private String artworkTitle; // name of the artwork private int artworkPrice; // price of artwork private boolean isSold; // if the artwork has been sold or not public Artwork(String artworkTitle, int artworkPrice) { this.artworkTitle = artworkTitle; this.artworkPrice = artworkPrice; isSold = false; // default value is not sold } public String getArtworkTitle(){ return artworkTitle; } public void isSold(){ isSold = true; } } // end of class Artwork

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)[3]

  • 10(d)[2]

  • 10(e)[4]

  • 10(f)[3]

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