i have learn this Java since last month for my work purposes. i wanted do this exercise. this is Vending Machine Program. I don't if write it in a wrong way. So i need somebody to show me the in my code. i know there must be wrong somewhere in the code. could somebody please help me to.
output for the program is supposed to be like this :
This Vending Machine program is a program that allow user to buy a can drinks. There are four types of can drink which is Pepsi, Coke, Orange and 7up. For that purposes user have to insert coins whereby valid inputs for the coins are RM1, 50 cents, 20 cents and 10 cents. The price for the can drinks is RM1.20 each. This program will read in number of coins from user until it reach the price and then ask user to choose the types of can drink that available and give balance to user and will then output the number of coins available and the drinks available. After that user can choose either to repeat the purchase or end the program.
There may still be some issues (such as the fact that I didn't tell you what to do with your coinInc() method -- I'll leave that to you to figure out) and the fact that the code I gave you will not work since you'll need to modify it to prompt the user to tell you the first coin they are putting in -- but that is the general idea. I'm also not sure how you are giving the user their change - that is up to you, and you might have handled it elsewhere in the program. I'm not sure, but again, just make sure everything is handled. Feel free to PM me or anything if you don't understand, but I'll respond in this thread.