Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Understand why customers are loyal to a particular service firm.

Answered: 1 week ago