1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
velikii [3]
3 years ago
6

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

shier to quickly undo a mistake. What instance variables should you add to the CashRegister class to support this modification
Computers and Technology
1 answer:
a_sh-v [17]3 years ago
3 0

Answer:

previousAddition instance variable

Explanation:

In order to accomplish this you would need to add a previousAddition instance variable. In this variable you would need to save the amount that was added at the end of the process. Therefore, if a mistake were to occur you can simply call the previousAddition variable which would have that amount and subtract it from the total. This would quickly reverse the mistake, and can be easily called from the undo() method.

You might be interested in
. Write a code to define a linked list node using the above defined structure student (i.e. the data of the node is a student st
enyata [817]

Answer:

struct node{

   student data;

   node* next;

};

Explanation:

The above written is the segment of code is the structure of node of the linked list.The data of the node is type student.So the data of the node of the linked list will consist of the student details and the next is the pointer which holds the address of the next node.

8 0
4 years ago
Which sns gets its names from one of its unique features
Komok [63]

Answer:

no

Explanation:

3 0
3 years ago
Nathan notices his computer system is slowing down when he tries to copy documents to it . He also gets to prompt that warns wit
IRISSAK [1]
Answer:D-optical drive
3 0
3 years ago
Read 2 more answers
Easy ;) what is another word for ram
Anni [7]
Shoved or pushed :))))))))))
3 0
3 years ago
Read 2 more answers
16. Which of the following is true about function return statements? A) A function can hold multiple return statements, but only
monitta

Answer:

A) A function can hold multiple return statements, but only one return statement executes in one function call

Explanation:

This is because each function can only return one value, whether it be an integer, String, or other object.

However, you can have a series of if-else statements, or case statements, to return a different value depending on information (within parameters, or variables.

Excellent. So, you can have multiple return statements, but the function will only end up executing one of these return statements and return a single value.

Hope this helps!

7 0
3 years ago
Other questions:
  • A blood bank maintains two tables - DONOR, with information about people who are willing to donate blood and ACCEPTOR, with info
    10·1 answer
  • What do students buy when they pay tuition?
    6·2 answers
  • What three characteristics of a function are described in an IPO chart? What is performed at each characteristic?
    12·1 answer
  • Which tab and group will allow the insertion of rows and columns in a worksheet?
    8·2 answers
  • Forensic scientists generally photograph and sketch a computer and its components during their analysis? True or false
    12·2 answers
  • You have purchased a printer that has the capability to print in duplex mode so that users can print on both sides of a sheet of
    7·1 answer
  • What usually happens during the investigation & analysis stage of the Systems Life Cycle
    15·1 answer
  • 2. Which of the following is a shortcut key to Exit from any operation?
    10·2 answers
  • An electronics company develops a line of augmented reality headsets for use in interactive 3d media applications using 5g mmwav
    7·1 answer
  • Where does blood travel when it leaves the right ventricle of the heart
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!