Question: We are going to create a simple cash register class. The cash register will have these members: An integer that holds the cash on hand
We are going to create a simple cash register class. The cash register will have these members:
An integer that holds the cash on hand in the register
A constructor that takes an integer parameter with a default value of If the parameter is greater than set the cash on hand to the parameter value, otherwise, set the cash on hand to
A method called acceptAmount that has an integer parameter and adds that value to the cash on hand.
A method that returns the cash on hand.
Your main method should create a cash register object, display the amount of money on hand, accept money into the cash register and display the cash on hand again. The output will be similar to this?
The front register has $
The front register has $
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
