Coding practice problem implementing a shopping cart