SHARE
TWEET

cpp

martukha Feb 18th, 2020 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include"figure.h"
  2. #include"volumetric.h"
  3. using namespace std;
  4. int main() {
  5.     Square square(4);
  6.     Rectungle rectangle(5, 6);
  7.     Triangle triangle(3);
  8.     Circle circle(4);
  9.     Prism square_prism(&square, 6);
  10.     cout << square_prism << endl;
  11.     cout << " Square Prism volume: " << square_prism.volume() << " cm^3" << endl;
  12.     cout << " Square Prism basis_area: " << square_prism.basis_area() << " cm^2" << endl;
  13.     cout << " Square Prism side_area: " << square_prism.side_area() << " cm^2" << endl;
  14.     cout << " Square Prism full_area: " << square_prism.full_area() << " cm^2" << endl << endl;
  15.  
  16.     Prism rectangle_prism(&rectangle, 10);
  17.     cout << rectangle_prism << endl;
  18.     cout << " Rectangle Prism volume: " << rectangle_prism.volume() << " cm^3" << endl;
  19.     cout << " Rectangle Prism basis_area: " << rectangle_prism.basis_area() << " cm^2" << endl;
  20.     cout << " Rectangle Prism side_area: " << rectangle_prism.side_area() << " cm^2" << endl;
  21.     cout << " Rectangle Prism full_area: " << rectangle_prism.full_area() << " cm^2" << endl << endl;
  22.  
  23.     Prism triangle_prism(&triangle, 8);
  24.     cout << triangle_prism << endl;
  25.     cout << " Triangle Prism volume: " << triangle_prism.volume() << " cm^3" << endl;
  26.     cout << " Triangle Prism basis_area: " << triangle_prism.basis_area() << " cm^2" << endl;
  27.     cout << " Triangle Prism side_area: " << triangle_prism.side_area() << " cm^2" << endl;
  28.     cout << " Triangle Prism full_area: " << triangle_prism.full_area() << " cm^2" << endl << endl;
  29.  
  30.     Cube cube(&square);
  31.     cout << cube << endl;
  32.     cout << " Cube volume: " << cube.volume() << " cm^3" << endl;
  33.     cout << " Cube basis_area: " << cube.basis_area() << " cm^2" << endl;
  34.     cout << " Cube side_area: " << cube.side_area() << " cm^2" << endl;
  35.     cout << " Cube full_area: " << cube.full_area() << " cm^2" << endl << endl;
  36.  
  37.     Cylinder cylinder(&circle, 8);
  38.     cout << cylinder << endl;
  39.     cout << " Cylinder volume: " << cylinder.volume() << " cm^3" << endl;
  40.     cout << " Cylinder basis_area: " << cylinder.basis_area() << " cm^2" << endl;
  41.     cout << " Cylinder side_area: " << cylinder.side_area() << " cm^2" << endl;
  42.     cout << " Cylinder full_area: " << cylinder.full_area() << " cm^2" << endl << endl;
  43.  
  44.     Cone cone(&circle, 6);
  45.     cout << cone << endl;
  46.     cout << " Cone volume: " << cone.volume() << " cm^3" << endl;
  47.     cout << " Cone basis_area: " << cone.basis_area() << " cm^2" << endl;
  48.     cout << " Cone side_area: " << cone.side_area() << " cm^2" << endl;
  49.     cout << " Cone full_area: " << cone.full_area() << " cm^2" << endl << endl;
  50.  
  51.     Ball ball(&circle);
  52.     cout << ball << endl;
  53.     cout << " Ball volume: " << ball.volume() << " cm^3" << endl;
  54.     cout << " Ball basis_area: " << ball.basis_area() << " cm^2" << endl;
  55.     cout << " Ball side_area: " << ball.side_area() << " cm^2" << endl;
  56.     cout << " Ball full_area: " << ball.full_area() << " cm^2" << endl << endl;
  57.  
  58.     system("pause");
  59.     return 0;
  60. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top