SilverhandX

circle.cpp

May 2nd, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. #include"circle.h"
  2.  
  3. void Circle::setRadius(double r)
  4. {
  5.     radius = r;
  6. }
  7.  
  8. double Circle::getRadius()
  9. {
  10.     return radius;
  11. }
  12.  
  13. double Circle::getArea()
  14. {
  15.     double area;
  16.  
  17.     area = pi * (radius * radius);
  18.  
  19.     return area;
  20. }
  21.  
  22. double Circle::getCircumference()
  23. {
  24.     double circ;
  25.  
  26.     circ = 2 * pi * radius;
  27.  
  28.     return circ;
  29. }
Add Comment
Please, Sign In to add comment