Answered step by step
Verified Expert Solution
Link Copied!

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 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

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

Define span of management or define span of control ?

Answered: 1 week ago

Question

What is meant by formal organisation ?

Answered: 1 week ago

Question

What is meant by staff authority ?

Answered: 1 week ago

Question

Discuss the various types of policies ?

Answered: 1 week ago