Question: JAVA Create classes that simulate a vending machine (we recommend 3 classes). Users select a product and provide payment. If the payment is sufficient to
JAVA Create classes that simulate a vending machine (we recommend 3 classes). 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.
Design each of the following classes (no code necessary).
- What are the instance attributes, their data types and valid ranges?
- What are instance methods needed, their arguments and return types?
- What are the class constants needed, their data type and value?
- What are the class attributes, their data types and valid ranges?
- What are class methods needed, their arguments and return types?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
