First of all, I would switch to the Currency variable type. It is guaranteed to not have decimal issues such as you might see with floating point numbers (Singles and Doubles). By the way, Doubles have
way more precision than you need for something like this. Their number of decimal digits harms their use in a case like this.
The basic algorithm is to try to divide by the highest denomination.
Keep track of how many times it is divisible, letâs say âDivNoâ.
If DivNo > 0 then subtract [DivNo à denomination] from the total, move to the next denomination down, and do that again.
Keep it up until you have used up the smallest denomination.
So you will need to keep a âtallyâ for [u]each</u> denomination, and you will need a temporary variable to keep the value that you will be subtracting from.
Using an array of denominations is good. You could add a second element that initializes to 0, to hold the tally for each denomination. (Be sure to have a separate array for each problem, or you will have data from one run possibly being âimposter dataâ for the next run.)
In
VB using â\â instead of â/â for a division problem executes integer division.
You should try to use shorter variable names. For instance, name your array Denoms (for âDenominationsâ).
Since you know in advance how large the array will be, you should dimension it in the declaration, rather than using a ReDim statement.
Is there really no 0.01 Euro coin?
Finally, with respect to English (though your English is actually good; probably the only reason I would have know that you are not a native English speaker is your âI'll first tell what I've got to makeâ instead of âFirst I'll first tell what I have to doâ.
But just as a tip (one which a lot of English speakers could stand to learn) is that words like "clear" are adjectives, they modify nouns: "This water is clear." "Your meaning is clear."
"Clearly" is an adverb, which modifies verbs:
"I'll try to explain my self as clear as possible" should be "I'll try to explain my self as clearly as possible"
"I'll try to express myself more clear" should be "I'll try to express myself more clearly" or "I'll try to be more clear" (Also, cannot and myself are each one word. Using "can not" and "my self" are also common mistakes.)
Is that helpful?