write a program that presents to the users a choice of your 4 favorite beverages (water, milk, juice and coffee) 2)Then allows the user to choose a beverage by chose. Use switch display the choice, 3)modify the program so that if the user enters a choice other than 1,2,3 and 4 then it will output "invalid choice" 4) modify your program to make the user enter a quantity of the chosen drink. If the user enters quantity outside of the range [1,5] then the program will output "invalid quantity" knowing that drink prices are respectively: 1 $, 1.5 $, 2$ and 1.7 $ print the total amount that the user should pay. 5) modify your program to ask the user to enter the amount of money first. 6) then they makes their choice and quantity. 7) if the money entered is less than the total amount, print " you can't buy this quantity of the chosen drink" otherwise, print the total amount and the remaining money.
((Java code))1) write a program that presents to the users a choice of your 4 favorite beverages (water, milk, juice and coffee)
2)Then allows the user to choose a beverage by chose. Use switch display the choice,
3)modify the program so that if the user enters a choice other than 1,2,3 and 4 then it will output "invalid choice"
4) modify your program to make the user enter a quantity of the chosen drink. If the user enters quantity outside of the range [1,5] then the program will output "invalid quantity" knowing that drink prices are respectively: 1 $, 1.5 $, 2$ and 1.7 $ print the total amount that the user should pay.
5) modify your program to ask the user to enter the amount of money first.
6) then they makes their choice and quantity.
7) if the money entered is less than the total amount, print " you can't buy this quantity of the chosen drink" otherwise, print the total amount and the remaining money.
thank you
Trending now
This is a popular solution!
Step by step
Solved in 6 steps with 8 images