//Programmer: Bo Bayles  Date: 19 October 2004
//File: box.cpp         Class: CS54 C
//Purpose: This file contains the function definitions that calculate the
//  volume of a box, display the volume of a box, and calculate the surface
//  area of the box.

#include "box.h"
#include <iostream>
using namespace std;
//Include the header and libraries.


float boxVolume(box boxDims)
{
  return (boxDims.length * boxDims.width * boxDims.height);
}
//Volume = l * w * h

void displayBox(box boxDims)
{
  cout << endl << "Box dimensions: " << boxDims.length << " x "
       << boxDims.width << " x " <<  boxDims.height << " in. " << endl;
  return;
}
//Output dimensions

float boxSurfaceArea(box boxDims)
{
  float fBoxArea = 0;

  fBoxArea = (2 * boxDims.length * boxDims.width);
 fBoxArea = fBoxArea + (2 * (boxDims.length + boxDims.width) * boxDims.height);

  return fBoxArea;
}
//Surface Area = (2 * l * w) + (2 * (l + w) * h)

void displaySummary(int iToyVolume, float fBoxVolume, float fBoxArea, box boxDims)
{

  cout << "== Shipping Summary ==" << endl
       << endl << "Toy volume: " << iToyVolume << endl;

       displayBox(boxDims);

       cout << endl << "Box volume: " << fBoxVolume << endl
       << endl << "== Materials Needed ==" << endl
       << fBoxArea << " square inches of cardboard" << endl
       << (fBoxVolume - iToyVolume) << " packing peanuts" << endl;
}
//Output the summary.

