Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Give back the customer change When the customer is done purchasing items, the machine should give back the remaining balance to the customer. Implement a
Give back the customer change
When the customer is done purchasing items, the machine should give back the remaining balance to the customer. Implement a method called outputchange that checks if there is any change to be given back and, if so prints the change in the following format:
Change: CHANGE
It should then set the customers balance to indicating the change has been given back to the customer.
If no change needs to be given back, it should simply print the message:
No change
Testing recommendations for outputchange:
When there is change ie balance
When there is no change ie balance
i Remove an item from the vending machine
If a snack is not selling well, the owner may want to remove it completely from the selection so it will no longer be restocked. Implement a method called removeitem that takes the name of a snack as a parameter, and removes it from the vending machine. If successful, it should print the following message:
ITEM removed from inventory
If the item to be removed does not exist in the machine, it should print the following message:
Invalid item
Testing recommendations for removeitem:
Removing a valid item
Removing an invalid item
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