Question: JAVA PROGRAMMING PLEASE! DESSERT This will be used as a starting point for deriving any specific Dessert type. Every Dessert type has one or more

JAVA PROGRAMMING PLEASE!
DESSERT This will be used as a starting point for deriving any specific Dessert type. Every Dessert type has one or more ingredient; therefore, a Dessert has the following abstract methods: > Dessert +baseCost(): double +ingredientsNeeded(): Ingredient[] +description(): String +double baseCost() returns the total price based on all the base ingredients used for a dessert. +String description() a method that returns the name of the dessert type. +Ingredient[] ingredients Needed() a method that returns the ingredient(s) used by a dessert. Note that the return type of the method is Ingredient. Define an enum datatype called Ingredient. The enum contains the following values (see below UML) and a constructor which sets the price for each ingredient. The enum also contains a getter method which returns the price per ingredient. The prices of the ingredient values are initialized as: Eggs(3.48), Sugar(2.89), Butter(3.99), Flour(3.24), Baking Powder(1.99), Baking Soda(.85), Flavoring(2.99), Fruit(5.50), Salt(.99), Milk(2.72), Cinnamon(2.99), Cream(3.12), YogurtCulture(4.95), Gelatin(3.99). > Ingredient Eggs Sugar Butter Flour Baking Powder Baking Soda Flavoring Fruit Salt Milk Cinnamon Cream Yogurt Culture Gelatin -price: double +Ingredient(double) +getPrice(): double
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
