In order to sort the shipments by weight, you will need to implement the sortShipmentsByWeight method in
Question:
In order to sort the shipments by weight, you will need to implement the sortShipmentsByWeight method in the Sort.java file. To implement the sortShipmentsByWeight you will need to implement the following two methods mergeSortShipmentsByWeight and merge method.
mergeSortShipmentsByWeight will take three arguments, an array of shipments, a start index, and an end index. This method should recursively call itself until the shipment has been sorted.
The merge method should merge two halves of the sorted shipment.
Task
Develop the sortShipmentsByWeight() method in the Sort.java file to sort cargo from heaviest to lightest.
2
The shipments now need to be distributed evenly among the vehicles. Each vehicle can do multiple transfers and can be used more than once if needed, but the weight limit of each vehicle cannot be exceeded.
The first method to implement is distributeShipmentsToVehicles which will return the maximum weight per load for each vehicle. Once the maximum capacity per vehicle has been calculated, the shipments need to be loaded onto the vehicle using the loadTheVehicles method.
Tasks
Develop the distributeShipmentsToVehicles method to evenly distribute weight between transportation vehicles but not exceed the weight limit of each vehicle. (Each vehicle can do multiple transfers/can be used more than once if needed)
2
Implement the loadTheVehicles method to load the shipments into the vehicles, the total capacity of the vehicles must be greater than the total weight of the shipment.
1
Implement the getLoadReport method in the LoadsOfVehicle.java file to generate a report.
2
Since the load reports will be read by humans and computers alike, it is important that the report format matches the sample report, including spaces.
Auditing And Assurance Services An Integrated Approach
ISBN: 9780135176146
17th Edition
Authors: Alvin A. Arens, Randal J. Elder, Mark S. Beasley