COSC 1437 P3 Delivery Truck Assignment

Write a program that uses 2 classes: Package and DeliveryTruck. 

Package Class:

  • The Package object will have 3 dimensions: length, width and height. The length should be the longest side.
  • Each Package should be able to calculate its own volume and package size
  • packageSize() is length (the longest side) + 2 * width + 2 * height
  • volume() is the volume of a cube

DeliveryTruck Class:

  • The DeliveryTruck object should have a vector of Package instances and a name
  • packageCount() should return the total number of Package instances
  • totalVolume() should iterate through the vector and add up the volume of each Package instance

Main Program:

  • The main function should have 1 DeliveryTruck instance
  • Allow the user to add packages by specifying the 3 dimensions. After each package is added, display its volume and size.  
  • After the user is finished adding packages, show the DeliveryTruck package count and total volume.
COSC 1437 P3 Delivery Truck Assignment