Write an Item with a name and a quantity. sell reduces the quantity by one, but not below zero. restock adds the amount given. inStock returns whether any remain, and getQuantity returns the count.
class Item { Item(String name, int qty); void sell(); void restock(int amount); boolean inStock(); int getQuantity(); }
Examples
There are also 3 hidden tests you can't see. Solve the problem, not the examples.