Hi There!
I'm currently studying basic programming, so far I'm really enjoying it and feel I'm doing quite well,
I'm currently working through week 11's exercises (I've gone ahead a bit, we're only on week 7 )
But this last question has me stumped. Now we "MUST" use a nested loop (do until/while, for/next, whatever)
What this loop is supposed to do is calculate every possible combination of coins (5c,10c,20c) that can make up 50c
example, the finished product should do something like this
5c-10c-20c
0 - 1 - 2
2 - 0 - 2
etc
And then display it in a list box.
it's the loop itself I'm struggling with, I'm sure making a separate loop for each coin type is the best way to do this,
if someone could, not so much do this for me, rather give me a shove in the right direction it would be greatly appreciated!
Many thanks
DosBoss.
I'm currently studying basic programming, so far I'm really enjoying it and feel I'm doing quite well,
I'm currently working through week 11's exercises (I've gone ahead a bit, we're only on week 7 )
But this last question has me stumped. Now we "MUST" use a nested loop (do until/while, for/next, whatever)
What this loop is supposed to do is calculate every possible combination of coins (5c,10c,20c) that can make up 50c
example, the finished product should do something like this
5c-10c-20c
0 - 1 - 2
2 - 0 - 2
etc
And then display it in a list box.
it's the loop itself I'm struggling with, I'm sure making a separate loop for each coin type is the best way to do this,
if someone could, not so much do this for me, rather give me a shove in the right direction it would be greatly appreciated!
Many thanks
DosBoss.
VB.NET:
PS, my variables are as follows,
Const FIVE As Integer = 5
Const TEN As Integer = 10
Const TWENTY As Integer = 20
Const FIFTY As Integer = 50
Dim FiveCoins As Integer
Dim TenCoins As Integer
Dim TwentyCoins As Integer
Dim Value As Integer