#include <iostream>
#include <cmath>
using namespace std;
class Box
{
public:
void volume();
void area();
void set();
Box (int h = 18,int w = 20,int len = 36):height(h),width(w),length(len){}
private:
double length;
double width;
double height;
};
int main()
{
Box a[5] = {
Box(10,12,15),
Box(15,18,20),
Box(16,20,26),
};
a[4].set();
cout << "the volume of a[0] is: " << endl;
a[0].volume();
cout << "the area of a[0] is: " << endl;
a[0].area();
cout << "the volume of a[0] is: " << endl;
a[1].volume();
cout << "the area of a[0] is: " << endl;
a[1].area();
cout << "the volume of a[0] is: " << endl;
a[2].volume();
cout << "the area of a[0] is: " << endl;
a[2].area();
cout << "the volume of a[0] is: " << endl;
a[3].volume();
cout << "the area of a[0] is: " << endl;
a[3].area();
cout << "the volume of a[4] is: " << endl;
a[4].volume();
cout << "the area of a[4] is: " << endl;
a[4].area();
system("pause");
return 0;
}
void Box::area()
{
double ar;
ar=2*(length * height + length * width + height * width);
cout << ar << endl;
}
void Box::volume()
{
double vol;
vol = height * width * length;
cout << vol << endl;
}
void Box::set()
{
cin >> height >> length >> width;
}