From what I know of javascript, I would create an object called "Quarter," "Dime," etc. Assign a value to each object (0.25, 0.10...) then create an ask box for each object, where the user inputs the number value of how many coins they have of each. "How many quarters do you have?" "How many dimes do you have?"
From here, it would look something like
Code:
Quarters * [ask value] + Dimes * [dimes ask value] ...
It's been forever so I can't tell you the specific operators for things like the ask value. Only the logical process I would do for a simple program to calculate this.
Also, this is javaSCRIPT, not java. Not sure if my answer is of any help, which is why I gave a process of logic rather than code.
Bookmarks