I am trying to write code for a project that deals with making change from money. I put the money presented and the total amount, but I can't get the change to show up in the list box? The change has to be broken down by fifties, twenties, tens, etc. Any Help?
writing code
Collapse
X
-
Dont realy understand what you want..Originally posted by gruvon69I am trying to write code for a project that deals with making change from money. I put the money presented and the total amount, but I can't get the change to show up in the list box? The change has to be broken down by fifties, twenties, tens, etc. Any Help?
What syntax are you writing in
Splitting up money could be done with a code like this (dont know if it is the best way
Money=1234 will give the valuesCode:int money=1234; int fifties, twenties, tens; fifties= Convert.ToInt32(Math.Floor((money/ 50))); money= money- fifties* 50; twenties= Convert.ToInt32(Math.Floor(money/ 20)); money= money- twenties*20; tens= Convert.ToInt32(Math.Floor(money/ 10)); money= money- tens*10;
fifties =24
twenties=1
tens=1
money=4 (the rest)
hope it helped
Comment