I need a vb.net code for function FRTData(price/vol kg, datatable) which returns a total(double datatype). I would like to include this vb.net function code to my existing project.
The function will take datatable and price/vol kg as inputs and returns total as a double.
The input datatable consist of different sizes(width and height)rows. The function should be smart enough to sort all the rows lowest at the top and highest width at
the bottom of table.
The function should return the lowest total price by trying different combination of boxes depending on number of items.
For example an order consists of 2. its pretty straight forward function will pick a box of 2 and input 2 row datatable with greatest width item defining the width of box then vol kg, total accordingly
same thing with 3 items boxes with greatest width item as defining the length of package.
Now if order consists of 4 items we have 2 options either we select a box of 4 or 2 boxes of 2 and 2. Here we want to see what is more cost
effective whether one box of 4 items or 2 boxes of 2 and 2.
we have to apply the same algorithm for for bigger number of total items to see what combinations give us the total lowest price for vol/kg
example will be an order which consists of 12 items. We want to see if what is more cost effective whether a combination of 6+6 or 4+4+4+4 or 6+4+2 or 3+6+3 and so on.
THE GOAL IS TO GET THE LOWEST TOTAL PRICE AS RETURN VALUE FROM THE FUNCTION WHEN INPUT IS DATATABLE AND PRICE/VOL KG