A Simple Class

 Exercise Write a simple class called Cube. The object should calculate the total area and the volume based on the side measurement. If the program supplies a side equal or lower than 0, reset the side to 1. Create an empty constructor and an empty destructor. Implement the object in different files.

`#ifndef CUBE_H#define CUBE_Hclass Cube{public:	Cube();	~Cube();	void setSide(double s);	double getSide();	double Area();	double Volume();	void Properties();private:	double Side;};#endif`
`#include <iostream.h>#include "cube.h"Cube::Cube(){}Cube::~Cube(){}void Cube::setSide(double s){	Side = s <= 0 ? 1 : s;}double Cube::getSide(){	return Side;}double Cube::Area(){	return 6 * Side * Side;}double Cube::Volume(){	return Side * Side * Side;}void Cube::Properties(){	cout << "Characteristics of this cube";	cout << "\nSide   = " << getSide();	cout << "\nArea   = " << Area();	cout << "\nVolume = " << Volume() << "\n\n";}`
`#include "cube.h"void main(){	Cube cube;	cube.setSide(-12.55);	cube.Properties();	Cube de;	de.setSide(28.15);	de.Properties();}`
`Characteristics of this cubeSide   = 1Area   = 6Volume = 1Characteristics of this cubeSide   = 28.15Area   = 4754.53Volume = 22306.7`