Computer Science · May / June 2025 · Paper 2 TZ3 HL · Question 14
IBCS
As printed in the paper
The question as text
14. 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 14 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
14(a)[1]
14(b)[2]
14(c)[3]
14(d)[2]
14(e)[4]
14(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.

