DESIGN A VENDING MACHINE IN JAVA 10 CLASSES VendingMachine It defines the public API of a vending machine, usually, all high- level functionality should go in this class VendingMachineImpl A sample...


Write the main class of this Java program vending machine


DESIGN A VENDING MACHINE IN JAVA<br>10 CLASSES<br>VendingMachine<br>It defines the public API of a vending machine, usually, all high-<br>level functionality should go in this class<br>VendingMachineImpl<br>A sample implementation of Vending Machine<br>VendingMachineFactory<br>A Factory class to create different kinds of Vending Machine<br>Item<br>Java Enum to represent Item served by Vending Machine<br>Inventory<br>Java class to represent an Inventory, used for creating the case<br>and item inventory inside Vending Machine<br>Coin<br>Another Java Enum to represent Coins supported by Vending<br>Machine<br>Bucket<br>A parameterized class to hold two objects. It's kind of Pair class.<br>NotFullPaidException<br>An Exception is thrown by Vending Machine when a user tries to<br>collect an item, without paying the full amount.<br>NotsufficientChangeException<br>Vending Machine throws this exception to indicate that it doesn't<br>

Extracted text: DESIGN A VENDING MACHINE IN JAVA 10 CLASSES VendingMachine It defines the public API of a vending machine, usually, all high- level functionality should go in this class VendingMachineImpl A sample implementation of Vending Machine VendingMachineFactory A Factory class to create different kinds of Vending Machine Item Java Enum to represent Item served by Vending Machine Inventory Java class to represent an Inventory, used for creating the case and item inventory inside Vending Machine Coin Another Java Enum to represent Coins supported by Vending Machine Bucket A parameterized class to hold two objects. It's kind of Pair class. NotFullPaidException An Exception is thrown by Vending Machine when a user tries to collect an item, without paying the full amount. NotsufficientChangeException Vending Machine throws this exception to indicate that it doesn't
have sufficient change to complete this request.<br>SoldoutExcepiton<br>Vending Machine throws this exception if the user requests a<br>product that is sold out.<br>Problem Statement<br>You need to design a Vending Machine which<br>1. Accepts coins of 1,5,10,25 Cents i.e. penny, nickel, dime,<br>and quarter.<br>2. Allow user to select products Coke(25), Pepsi(35), Soda(45)<br>3. Allow user to take refund by canceling the request.<br>4. Return the selected product and remaining change if any<br>5. Allow reset operation for vending machine supplier.<br>VendingMachine Class<br>Fielde<br>count: Int<br>- capacity: Int<br>- moneyCollected: int<br>- manufacturer: string<br>+ Dieplay(): void<br>• DiaponsoProducts): void<br>+ Refili(): vold<br>Methods<br>

Extracted text: have sufficient change to complete this request. SoldoutExcepiton Vending Machine throws this exception if the user requests a product that is sold out. Problem Statement You need to design a Vending Machine which 1. Accepts coins of 1,5,10,25 Cents i.e. penny, nickel, dime, and quarter. 2. Allow user to select products Coke(25), Pepsi(35), Soda(45) 3. Allow user to take refund by canceling the request. 4. Return the selected product and remaining change if any 5. Allow reset operation for vending machine supplier. VendingMachine Class Fielde count: Int - capacity: Int - moneyCollected: int - manufacturer: string + Dieplay(): void • DiaponsoProducts): void + Refili(): vold Methods
Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here