dontcare_hi

Untitled

Jan 27th, 2022
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. class Point {
  4. public:
  5. int x;
  6. int Show_x ();
  7. public:
  8. int y;
  9. int Show_y ();
  10. };
  11. int Point::Show_x() {
  12. return x;};
  13. int Point::Show_y() {
  14. return y;};
  15.  
  16. class circle {
  17. public:
  18. int get_x;
  19. int Show_x ();
  20. public:
  21. int get_y;
  22. int Show_y ();
  23. protected:
  24. int r;
  25. int show_r ();
  26.  
  27. class cylinder {
  28. public:
  29. int get_x;
  30. int Show_x ();
  31. public:
  32. int get_y;
  33. int Show_y ();
  34. int get_r;
  35. int show_r ();
  36. protected:
  37. int h;
  38. int show_h ();
  39. void show();
  40. Cylinder (int x, int y, int r, int h) {
  41. }
  42.  
  43. int main() {
  44. cylinder cylinder1(5, 6, 2, 10);
  45. cylinder cylinder2(2, 15, 15, 100);
  46. cylinder cylinder3(9, 90, 30, 105);
  47.  
  48. cout << "Cylinder 1 : " << x << ", "
  49. << y << ", "
  50. << r << ", "
  51. << h << "\n\n";
  52.  
  53. cout << "Cylinder 2 : " << x << ", "
  54. << y << ", "
  55. << r << ", "
  56. << h << "\n\n";
  57.  
  58.  
  59. cout << "Cylinder 3 : " << x << ", "
  60. << y << ", "
  61. << r << ", "
  62. << h << "\n\n";
  63. ;
  64.  
  65. cout << "Cylinder 1: "; cylinder1.show_r();
  66. cout << "Cylinder 2: "; cylinder2.show_r();
  67. cout << "Cylinder 3: "; cylinder3.show_r();
  68.  
  69. return 0;
  70. }
  71. };
  72.  
Advertisement
Add Comment
Please, Sign In to add comment