I have been trying to solve this problem for days, and if I think about this anymore I might blow my brains out.
Anyways, I need help solving a smaller portion of a large assignment for my computer science course.
The program basically entails me creating a shipping manifest for a company. I am stuck trying to split up orders among trucks.
The restrictions placed on filling the trucks are as follows:
1.) Trucks must be filled with items in "Customer Order. That is Customer 1's orders must be filled first then Customer 2's then Customer 3's, etc.
2.)Each truck can hold a maxinum of 40 items.
3.) When multiple trucks are used, the orders must be distributed as evenly as possible between the trucks, keeping in mind that you must use as few trucks as possible and the orders must be filled in "Customer Order".
4.)No orders can be split, except for orders over 40.
-For orders over 40, split them as evenly as possible(for example: an order of 70
must be split 35 - 35 and order of 150 must be split 37 - 37 - 38 - 38).
-Trucks used for split orders must be used solely for that split order (They can not
hold any other Customer's orders.)
Examples of trucks being split properly:
Orders: 3 8 9 3 50 5 6
Truck 1 holds: 3 8 9 3 for a Total of 23.
Truck 2 holds: 25.
Truck 3 holds: 25.
Truck 4 holds 5 and 6 for a Total of 11.
Orders: 5 44 18 18 8 100 3
Truck 1 holds: 5
Truck 2 holds: 22
Truck 3 holds: 22
Truck 4 holds: 18
Truck 5 holds: 18 8 for a Total of 26.
Truck 6 holds: 33
Truck 7 holds: 33
Truck 8 holds: 34
Truck 9 holds: 3
Note: I can only build linked-lists using pointers. No arrays are allowed in this program.
If someone can please help me with this it would be greatly appreciated. Even if your help is so much as a nudge in the right direction. I have literally been thinking about this for over a week and I can not solve this problem.