Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

HW3: for this homework, you will create a Java program that will calculate the amount of money required to buy an expresso drink with additional

image text in transcribed

HW3: for this homework, you will create a Java program that will calculate the amount of money required to buy an expresso drink with additional cream or sugar using if / else statements. Offer a selection of at least 3 different expresso drinks with corresponding numbers for input. Charge different prices for the 3 drinks. Validate the input is one of the offered expresso selections, otherwise, notify the user of an incorrect entry and set the expresso drink value to zero. If the user entered a valid value for their expresso drink, offer them a condiment such as cream and / or sugar factoring that into the total cost (charge at least 0.25). Calculate the total cost of the drink and display it to the user. Example: Psuedo Code to show flow: 1. Declare variables and initialize 2. Output: Enter the number of expresso coffee you want to order: Americano - 1, Cappuccino - 2, Mocha - 3? 3. Input from user 4. Validate Input 5. Determine expresso drink and charge price 6. Output: Add Cream - 4 or Sugar - 5 or 0 for no? 7. Input from user 8. Output: Total cost of your expresso is

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 Technology And Management Computers And Information Processing Systems For Business

Authors: Robert C. Goldstein

1st Edition

0471887374, 978-0471887379

More Books

Students also viewed these Databases questions