// ファイル名： Ch04/funcBox_04.cc 
#include <iostream> 
using namespace std; 
double getBoxVolume(double, double, double); 
double getBoxSurface(double, double, double); 
 
const double m(1.0),   cm(1.0e-2*m), mm(1.0e-3*m); // 長さ 
const double m2(m*m),  cm2(cm*cm),   mm2(mm*mm);   // 面積   
const double m3(m2*m), cm3(cm2*cm),  mm3(mm2*mm);  // 体積 
 
int main() { 
  double x=35.0*cm, y=2.5*mm, z=1.5*m; 
  cout << "Vol(cm3)= " << getBoxVolume(x,y,z)/cm3  << endl; 
  cout << "Srf(mm2)= " << getBoxSurface(x,y,z)/mm2 << endl; 
  return 0;  } 
 
double getBoxVolume(double xL, double yL, double zL){ 
  double vol = xL*yL*zL;   return vol;  } 
 
double getBoxSurface(double xL, double yL, double zL){ 
  double srf = 2.0*(xL*yL + xL*zL + yL*zL);  
  return srf;  }
