If i have currencies that are in decimals {0.7,0.8,1.4,0.5} and total amount which also has decimals (example: 1279.6) and I tell you that you need to make total within certain number of currency note counts (example: Total has to be 27.6 and available currencies are 0.7,0.8,1.4,0.5 and you have to use 35 counts of total no. of currency notes. what will be the counts of each currency to make up that total?) The answer to that question would be (13 notes of 0.7 currency + 7 notes of 0.8 currency + 6 notes of 1.4 currency + 9 notes of 0.5 currency would total to 27.6 and total currency count is 35 notes (13+7+6+9))? How can I achieve this through mathematical equations?
Asked
Active
Viewed 32 times
$888then I will start by using maximum no. of highest value currency like eight$100bill and then go down in descending order. With denominations like$1, $2, $5, $10, $20, $50, and$100, you can make up any value. but what if you have denominations like$3, $7, $13, $11, $24, $44, and$97and using this you have to make up $888. Maybe You can do it but not by using usual method of going from higher to lower denomination. You have to iterate to find out. this is where i am stuck – GirKarr Oct 23 '18 at 10:57