// Ex7_03a.cpp
// Calculating the volume of a box with a member function
#include <iostream>
using std::cout;
using std::endl;

class CBox                               // Class definition at global scope
{
public:
  double m_Length;                // Length of a box in inches
  double m_Width;                 // Width of a box in inches
  double m_Height;                // Height of a box in inches
  double Volume(void);                // Function Prototype
};

int main()
{
  CBox box1;                             // Declare box1 of type CBox

  box1.m_Height = 2.0;                  // Define the values
  box1.m_Length = 3.0;                  // of the members of
  box1.m_Width = 4.0;                   // the object box1

  double boxVolume = box1.Volume();             // Calculate new volume of box1
  cout << "Volume of box1 is now: " << boxVolume << endl;

  return 0;
}

double CBox::Volume(void)
{
    return m_Length*m_Width*m_Height;
}
