need help to write Code in C#
"enumerate all the ways of making change for X cents."
For example, if given 10 cents, the possibilities include:
10 pennies, 5 pennies and 1 nickel, 2 nickels, and 1 dime.
You can assume the allowable denominations are pennies,
nickels, dimes and quarters.
cents : number of cents that you should enumerate the
change possibilities for (for example, 82)
Above C# Code used should be non-recursive.
Re: need help to write Code in C#
I dont think you can dump your school assignments here...
Re: need help to write Code in C#
not going to tell you how to do your hw,
but your logic should be:
for every option (bigger to smaller)
try to fit into given amount. all leftovers try to fit to smaller amounts. if successful - it means that in end of this process there will be no leftovers.
it is a simple / , % solution
Re: need help to write Code in C#
For homework assignments, the best hing is to try your best, and when you get stuck post the code you have and we can help you get unstuck.