Question: Reimplement the CashRegister class so that it keeps track of the price of each added item in an ArrayList. Remove the itemCount and totalPrice instance

Reimplement the CashRegister class so that it keeps track of the price of each added item in an ArrayList. Remove the itemCount and totalPrice instance variables. Reimplement the clear, addItem, getTotal, and getCount methods. Add a method displayAll that displays the prices of all items in the current sale.

Step by Step Solution

3.44 Rating (163 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

public class CashRegister private ArrayList prices constructor public CashRe... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Java Concepts Late Objects Questions!