Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. /* run this program using the console pauser or add your own getch, system("pause") or input loop */
  4.  
  5. using namespace std;
  6.  
  7. class Circle
  8. {
  9.  
  10. private:
  11.  
  12.  
  13. public:
  14. float radius;
  15. float x;
  16. float y;
  17.  
  18.  
  19. Circle(float Radius, float X, float Y) : radius(), x(), y()
  20. {
  21. radius = Radius;
  22. x = X;
  23. y =Y;
  24. }
  25.  
  26. void getRadius(){ // ãåòòåð ðàäèóñà
  27. cout <<"Radius: "<<radius<<endl;
  28. }
  29.  
  30. void getCoordinate(){
  31. cout << "X: "<<x<<";\n"<<"Y: "<<y<<";\n"<<endl;
  32. }
  33.  
  34. float transX(float peremeshenie){
  35. return x + peremeshenie;
  36. }
  37.  
  38. float transY(float peremeshenie){
  39. return y + peremeshenie;
  40. }
  41.  
  42. };
  43.  
  44.  
  45.  
  46. int main(int argc, char** argv) {
  47.  
  48.  
  49.  
  50. Circle objCircle(10,12,12);
  51.  
  52. objCircle.getRadius();
  53. objCircle.getCoordinate();
  54.  
  55. objCircle.transX(2.3);
  56.  
  57. return 0;
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement