Question
Write a cash register class. It should have the following methods: AddTransaction(amount) add an amount to a running total and increments the number of transactions
Write a cash register class. It should have the following methods:
AddTransaction(amount) add an amount to a running total and increments the number of transactions
TransactionCount( ) returns the number of transactions received
Total( ) returns the sum of the amounts of the transactions
ResetTransactions( ) sets the total amount and transaction count to 0
Register Count( ) returns the number of cash registers created
Next, write an application that instantiates at least two cash register objects to prove that your class works. P.S.: Don't worry about storing each individual transaction, and we are dealing only with totals. No need to handle individual orders/items per transaction.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started