You are on page 1of 1

#include <iostream>

#include <cmath>
#include <string>
#include <iomanip>

using namespace std;

class Cube1
{
float Surface_Area;
float Volume_of_cube;
float a;

public:
void setinput()
{
cout << "Please enter the one side of cube a= " << endl;
cin >> a;
}
void Area()
{
Surface_Area = 6 * (pow(a, 2));
cout << "The Surface Area of cube is: " << Surface_Area << endl;
}

void Volume()
{
Volume_of_cube = pow(a, 3);
cout << "The Volume of cube is: " << Volume_of_cube << endl;
}
};

int main()
{

Cube1 A, B;
A.setinput();
B.setinput();
A.Area();
B.Volume();

return 0;
}

You might also like