I was wondering if someone is able to help with the logic for an application.
I am currently looking at an application within the company that has received an error.
The issue is to do with the original coding as a case statement that the parameter has exceeded.
The application is coded in vb.net and needs to work out the number of pallets that should be used based on a quantity of cartons (for shipments).
I spoke to the warehouse and they said the following logic is used:
14 -40 cartons = 1 pallet
41- 80 cartons = 2 pallets
81 – 120 cartons = 3 pallets
And so on ………
14 -40 cartons = 26 cartons = 1 pallet
41- 80 cartons = 39 cartons = 2 pallets
81 – 120 cartons = 39 cartons = 3 pallets
I did think about trying to divide but if for example you took:
3125 / 39 = 81 this is not correct
a case statement exists and a quantity of 79 pallets should be used.
I am not sure what the best way of coding this would be? Any help would be appreciated.