Question: 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 output_change 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 0.0, 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 output_change:
When there is change (i.e., balance >0)
When there is no change (i.e., balance =0)
1i. 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 remove_item 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 remove_item:
Removing a valid item
Removing an invalid item

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!