Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with the following output with this java objects and classes coding. Would you like to filter the result by 1. Calories ,2.Total

I need help with the following output with this java objects and classes coding. Would you like to filter the result by 1. Calories ,2.Total fat.3.Sugar.4.View all items on menu, 5. Exit program

Enter your Choice(1-5): 4

Our menu items for today include: Caffe Misto, size='Short', calories=70, totalFat=2.0, sugar=5, price=$5.99

Vanilla Sweet Cream Cold Brew, size = 'Tall, calories=100, totalFat=6.0, sugar=12, price = $6.99

Caffe Mocha, size = 'Short', calories= 120, totalFat= 105.0, sugar=17, price = $3.99

Enter your Choice(1-5): 1.Enter Max calories, than got the options according to the entered calories

Enter your Choice(1-5): 2. Enter max total grams of fat, than got the options according to the entered calories

Enter your Choice(1-5): 3. Enter max grams of sugar , than got the options according to the entered calories

At the end, user will exit the program . This program needs to follow this starter code

public class Main {
 public static void main(String[] args) { System.out.println("Welcome to MoonBucks Coffee House"); Drink[] menu = new Drink[3]; /* Create 3 objects using the Drink class and add them to the menu array Use real data from: https://globalassets.starbucks.com/assets/94fbcc2ab1e24359850fa1870fc988bc.pdf Also, assign each drink a fictional price. */ /* Add your code here */ // Sample code to display all menu item names System.out.println("Our menu items for today include:"); for (Drink each: menu) { System.out.println(each.getName() + ": $" + each.getPrice()); } } }image text in transcribed
Assignment 5: Coffee Shop - OOP Basics Hide Assignment Information Instructions Classes and Objects Introduction: Moonbucks Coffeehouse is looking to upgrade their computer systems. The system will allow a user to enter various drinks into the system, then display all the items or filter the items based on calories, fat, and sugar content. Requirements: - Part 1 - Create a Drink class with all the appropriate data fields, setters, getters, and constructors. - Make sure all data fields are private. - Part 2 - Create a program that prompts the user if they'd like to filter the menu by calories, fat, or sugar content, then displays the matching results

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Driven Web Sites

Authors: Joline Morrison, Mike Morrison

2nd Edition

? 061906448X, 978-0619064488

More Books

Students also viewed these Databases questions

Question

What is Change Control and how does it operate?

Answered: 1 week ago

Question

How do Data Requirements relate to Functional Requirements?

Answered: 1 week ago