Advertisement
Guest User

Untitled

a guest
Oct 21st, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3. using namespace std;
  4.  
  5. const double PI = 3.14;
  6.  
  7. void pause()
  8. {
  9.     cout << "Press any key to continue..." << endl;
  10.     _getch();
  11. }
  12.  
  13. class Circle {
  14.  
  15. private:
  16.  
  17.     double radius;
  18.  
  19. public:
  20.  
  21.     void set_radius(int r)
  22.     {
  23.         radius = r;
  24.     }
  25.  
  26.     double get_radius()
  27.     {
  28.         return radius;
  29.     }
  30.  
  31.     double get_diameter()
  32.     {
  33.         return radius * 2;
  34.     }
  35.  
  36.     double get_circumference()
  37.     {
  38.         return PI*radius * 2;
  39.     }
  40. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement