// Example 66 #include #include #include using namespace std; #include "sphere2.h" int main() { sphere globe1, globe2, globe3; globe1.assign_center( 1.0, 2.0, 3.0 ); globe1.assign_radius( 5.0 ); globe2 = globe1.shifted_sphere( 1.0, 1.0, 1.0 ); double x = globe2.get_x_coord(); double y = globe2.get_y_coord(); double z = globe2.get_z_coord(); double r = globe2.get_radius(); cout << "Globe2...\n"; cout << "The sphere is centered at (" << x << "," << y << "," << z << ")"; cout << "\nand it has radius " << r << "\n"; cout << "The volume of the sphere is " << globe2.volume() << endl; globe3 = globe2; globe3.shift_sphere( 2.0, 4.0, 6.0 ); x = globe3.get_x_coord(); y = globe3.get_y_coord(); z = globe3.get_z_coord(); r = globe3.get_radius(); cout << "\nGlobe3...\n"; cout << "The sphere is centered at (" << x << "," << y << "," << z << ")"; cout << "\nand it has radius " << r << "\n"; cout << "The volume of the sphere is " << globe2.volume() << endl; cout << "\n\n"; system( "PAUSE" ); return( EXIT_SUCCESS ); }