Displaying note/coin combinations from change
I was just wondering how I could display note/coin combinations from a calculated amount?
My program so far reads in a price for a certain shopping item and then works out the change due from the amount of cash a user enters. So say if £354 is read in as the value if the item, and then the user enters £400 on the keyboard, it displays the change as £46.00. What I want know is for it to also display the note/coin combinations to get this amount, so for this example it would be:
10 pound notes - 4
5 pound notes - 1
2 pound coins - 0
1 pound coins - 1
50 pence coins - 0
20 pence coins - 0
10 pence coins - 0
5 pence coins - 0
2 pence coins - 0
1 pence coins - 0
How would I get the program to work this out?
Any help would be greatly appreciated, thank you.
Re: Displaying note/coin combinations from change