Question: Suppose the CashRegister needs to support a method void undo() that undoes the addition of the preceding item. This enables a cashier to quickly undo

Suppose the CashRegister needs to support a method void undo() that undoes the addition of the preceding item. This enables a cashier to quickly undo a mistake. What instance variables should you add to the CashRegister class to support this modification?

Step by Step Solution

3.34 Rating (166 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Instance variables are declared in a class but outside a method constructor or any block When space ... 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

Document Format (2 attachments)

PDF file Icon

2106_61d6ac3466d10_873056.pdf

180 KBs PDF File

Word file Icon

2106_61d6ac3466d10_873056.docx

120 KBs Word File

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