I need to get inherited class of DispenseAlgorithm. It must realize algorithm for calculate issuance of delivery. The algorithm must provide even nominals consumption .
public abstract class DispenseAlgorithm
{
public abstract Dictionary<int, int> CalculateDispense(CassetteData[] data, int summ);
}
public class CassetteData
{
public int UID { get; set; }
public int Nominal { get; set; }
public int Count { get; set; }
public CassetteData() { }
}
The class CassetteData – provides info about set of denomination at current time (Nominal - value of nominal denomination, Count – quantity of denomination, UID - unique identifier of denomination set).
The method CalculateDispense has 2 parametes: - available at current time denomination set (CassetteData{] data) - sum we pay out (or give out) as cashback.
The method CalculateDispense must return object Dictionary, where key - unique identifier of denomination set , and value – quantity of denomination required to payment.
Wishful result: denomination must comes to end as evenly as possible at some sessions issuance of delivery
For example: We have denomination sets:
1 10 $ 100 denomination
2 50 $ 100 denomination
3 100 $ 100 denomination
We need to pay out 800$
Good result:
1 5 items
2 5 items
3 5 items
Because 800 = 10 * 5 + 50 * 5 + 100 * 5
Bad result:
1 0 items
2 0 items
3 8 items
Because 800 = 10 * 0 + 50 * 0 + 100 * 8
Denomination are means money, note, cut, bank note,bond
issuance of delivery are means issuance of cashback
Nominal - par, face value, par value, nominal value, rating