Answered step by step
Verified Expert Solution
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
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
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