#include #include #include "CubeClass.h" using namespace std; int main() { double height, width, depth; cout << "Hello. I can calculate the volume of three cubes, mmmkay?\n"; cout << "Enter the properties of the first cube.\n"; cout << "Height: "; cin >> height; cout << "Width: "; cin >> width; cout << "Depth: "; cin >> depth; // at this point, local variables height, width and depth // have values assigned. Cube rubiks_cube(height, width, depth); // "Computer, create a Cube called rubiks_cube with these dimensions" // Note that these are passed by value. // So if local variables height, width and depth change here in main(), // it has no effect on rubiks_cube. cout << "Enter the properties of the second cube.\n"; cout << "Height: "; cin >> height; cout << "Width: "; cin >> width; cout << "Depth: "; cin >> depth; // new values assigned to local variables height, width, depth Cube ice_cube(height,width,depth); // "Computer, create a Cube called ice_cube with these dimensions" cout << "Enter the properties of the third cube.\n"; cout << "Height: "; cin >> height; cout << "Width: "; cin >> width; cout << "Depth: "; cin >> depth; // new values assigned to local variables height, width, depth Cube giant_cube_o_death(height,width,depth); // "Computer, create a Cube called giant_cube_o_death // with these dimensions" cout << "Totally radical, mmmkay? Here are the repective volumes: \n"; cout << "Volume of first cube: " << rubiks_cube.volume() << endl; cout << "Volume of second cube: " << ice_cube.volume() << endl; cout << "Volume of third cube: " << giant_cube_o_death.volume() << endl; cout << "\nMmmmmkay?\n\n"; system("PAUSE"); return 0; }