FETCH THE CURRENT DENOMINATIONS & AVAILABLE NUMBERS OF THE ASSIGNED_TO PARTNER AND ASSIGN IT TO ARRAY (NOTE: IF AVAILABLE NUMBER IS 0 THEN IT IS NOT COUNTED) Define 2D Array; FOR EACH available denomination with stock assign the following: Array(i,1) = Denomination ; Array(i,2) = Available Stock in number ; Array(i,3) = Allocated (INITALLY 0)
ACTUAL_ALLOT_QTY = 0 For Qty = 0 to MAX_ALLOT_LTR Temp_Denom = 0 for i= 1 to Array Size If Array(i,2) > Array (i,3) IF (ACTUAL_ALLOT_QTY + Array(i,1)) <= MAX_ALLOT_LTR ACTUAL_ALLOT_QTY = ACTUAL_ALLOT_QTY + Array(i,1) Array (i,3) = Array (i,3) + 1 Qty = Qty + Array (i,1) ELSE Temp_Denom = Temp_Denom + 1 END IF Else Temp_Denom = Temp_Denom + 1 End If Next i IF Temp_Denom = Array Size THEN Qty = MAX_ALLOT_LTR Next Qty
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)