Question: 1) Design class that simulates a vending machine. Users select a product and provide payment. If the payment is sufficient to cover the purchase
1) Design class 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. Do you need one class or more to solve this problem? 2) Document your class(s). 3) Provide a tester class and test a scenario in which you create a vending Machine and use it to purchase two products; once with sufficient payment amount and another with not providing enough payment, print the corresponding change results.
Step by Step Solution
3.49 Rating (149 Votes )
There are 3 Steps involved in it
Our solution to the given problem is a class that acts like a vending machine Users can choose a product pay and handle the products dispensing and return change with this vending machine Weve impleme... View full answer
Get step-by-step solutions from verified subject matter experts
