Question: Please code this in Java according to the instructions. Thank You Exercise 3 of 3: Write a Java program that lets the user buy a

Please code this in Java according to the instructions. Thank You ExercisePlease code this in Java according to the instructions. Thank You

Exercise 3 of 3: Write a Java program that lets the user buy a drink from a vending machine The Machine has three drinks available: Coke: $2.41 .Red Bull:$4.63 Water: $1.11 The user will first pick a drink, then the user will be told how much they owe. Then the user enters how much they pay. Calculate how much money the machine should return to the user, and then calculate the smallest possible amount of bills and coins to return to the user. For example, the user buys a coke and pays $5. The machine should return to the user two $1 bills, two quarters, a dime, and four 1c pieces. (total of $2.59)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!