Help build this code | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Help build this code

Simulate the operation of a Coke machine. This machine offers Coke, Coke Zero, and Caffeine-free Diet Coke. All drinks cost $1 (100 cents). The machine does not take dollar bills or pennies, but it does take nickels, dimes, and quarters. When enough money has been entered, a drink may be selected, and any change is returned (the specific coins are listed).Only coins in denominations of 5, 10, and 25 cents are accepted. Any other denomination (33 cents, 50 cents, etc.) is rejected and returned. More than one drink may be purchased (that is, the program doesn't quit after selling one drink).There is no way to turn off the coke machine. When you run the program from within Eclipse, you can stop it by pressing the red square.

16th Mar 2018, 4:01 PM
Arcanej03
Arcanej03 - avatar
2 Answers
+ 3
What have you done to achieve this on your own?
16th Mar 2018, 7:00 PM
David Akhihiero
David Akhihiero - avatar
+ 2
Is this hw?
16th Mar 2018, 4:08 PM
Ariela
Ariela - avatar