CAPE Computer Science Unit 2 · 2006 · Paper 2 · Question 6(a)
A company stores product data: name, inventory amount, reorder level, and price. A Product class must include these instance variables, a constructor, getters, a toString() method, and specific methods for reducing stock and determining reorder status.
Write the code for the Product class including the instance variables, constructor, accessor methods, toString() method, and the methods reduceItems(int amt) and reorder() as specified.
This question uses a figure or table from the paper — you'll see it when you practise.
The mark scheme is shown once you've answered.
Practise this question