Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using Java please. Design classes that store the information about various kinds of drinks. The system will support at least these drinks: coffee, tea and
Using Java please.
Design classes that store the information about various kinds of drinks. The system will support at least these drinks: coffee, tea and juice. For each kind of drink, the system will store some attributes. For coffee, it will be at least the kind (e.g. espresso, cappuccino), volume, price, and condiments. For tea, it will be at least the price, volume, kind (e.g.green, black), and condiments. For juice, it will be at least the kind (e.g. orange, apple, cranberry), volume and price. The system will support at least these condiments: cream, sugar, honey and cinnamon. For each condiment, the system will store the volume and price. Each drink will provide a method that prints all the information about that drink. For example, coffee will print as follows: Coffee, id: 1, volume: 10, price: 4.99, kind: espresso, condiments: cream, sugar The price printed will be the price of coffee plus the price of condiments. Tea will print as follows: Tea, id: 2, volume: 20, price: 3.48, kind: green, condiments: milk Again, the price will be the price of tea plus the price of condiments. Juice will print as follows: Juice, id: 3, volume: 20, price: 3.75, kind: cranberry Each class will provide suitable constructors and methods. Each drink will have a unique ID that will be assigned automatically. In addition to requirements specified above, your code will be assessed using the following criteria: 1. Proper use of inheritance 2. Proper use of abstract classes 3. Proper use of abstract methods 4. Proper use of final 5. Proper use of overriding 6. Proper use of overloaded constructors
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started