ive designed a GUI for a vending machine, but i have know idea on how to do one thing

i need help calculating the users change

the user types in e.g. 100 for coffee

the cost of coffee is 60

and then the change appears in a new window

i just need a push in the right direction becasue i have know idea where to start.

don't you think is funny you able to do GUI but not simple calculations??
anyway there are some examples of vending machine in Java section posted not long ago

plus there is list of similar threads just bellow post

is it that time of the month again?
Maybe we should make a calendar out of it, there's a very regular pattern in which homework questions appear when and in what order...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.