Question: Your task is to write a program that simulates a vending machine. Users select a product and provide payment. If the payment is sufficient to
Your task is to write a program that simulates a vending machine. Users select a product and provide payment. If the payment is sufficient to cover the purchase price of the product, the product is dispensed and change is given. Otherwise, the payment is returned to the user. Name an appropriate class for implementing this program. Name two classes that would not be appropriate and explain why.
••
Step by Step Solution
3.38 Rating (157 Votes )
There are 3 Steps involved in it
An appropriate class for implementing this program could be named VendingMachine This class would encapsulate the behavior of a vending machine like d... View full answer
Get step-by-step solutions from verified subject matter experts
