i need the code for a small app that will take input and display the change to be given.
it is suppose to look something like this...
What is the Cost of the goods?
111.12
How much was received?
2000
YOUR CHANGE IS:
HUNDRED RANDS : 8
FIFTY RANDS : 1
TWENTY RANDS : 1
TEN RANDS : 1
FIVE RANDS : 1
TWO RANDS : 1
ONE RANDS : 1
50 CENTS : 1
10 CENTS : 3
5 CENTS : 1
2 CENTS : 1
1 CENTS : 1
Rands being the currency we use in my country..
Please help!!!
Small console app to calculate change.
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

PJ MartinsRank #2,548 · 548 reputationPosted May 25, 2010, 2:02 PM EDT
double kleinGeld = 2000 - 111.12;
Console.WriteLine("Hundreds Rands: " + Math.Floor(kleinGeld / 100).ToString());
kleinGeld -= 100 * Math.Floor(kleinGeld / 100);
Console.WriteLine("Fifty Rands: " + Math.Floor(kleinGeld / 50).ToString());
kleinGeld -= 50 * Math.Floor(kleinGeld / 50);
.
.
.
Console.WriteLine("2 Cents: " + Math.Floor(kleinGeld / .02).ToString());
kleinGeld -= .02 * Math.Floor(kleinGeld / .02);
Console.WriteLine("1 Cents: " + Math.Floor(kleinGeld / .01).ToString());
CJ van Aswegen3 reputationPosted May 26, 2010, 12:16 AM EDT