Fill This Form To Receive Instant Help
Homework answers / question archive / Draw a Class Diagram for the following system using UML Diagram: 1
Draw a Class Diagram for the following system using UML Diagram:
1. Snack:
a) Has a public name
b) Has a public price, and c) Has a private number of calories.
2. VendingMachine:
a) Has a VendingInterface
b) Aggregates multiple Snacks
c) Has a method onSnackSelected(String name)
d) Has a method getSnack(): Snack
3. VendingInterface (Interface that Communicates with the VendingMachine):
a. Has a method addmoney(double money)
b. Has a method refundmoney()
4. Payment (Implements VendingInterface): a) Overrides addmoney(double money)
b) Overrides refundmoney()