Guest User

Untitled

a guest
Sep 30th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.66 KB | None | 0 0
  1. #include<iostream.h>
  2. #include<conio.h>
  3. #include<string>
  4.  
  5. class Circle{
  6. private:
  7.     double radius; //mienbro dato(variable)
  8.    string color;
  9. public:
  10.     void Leer() //funcion mienbro
  11.    {
  12.     cout<<"Radio : ";cin>>radius;
  13.       cout<<"Color : ";cin>>color;
  14.    }
  15.    double getRadius(){    //funcion mienbro(getter)
  16.     return radius;
  17.    }
  18.    string getColor(){
  19.     return color;
  20.    }
  21.    double getArea(){
  22.     return radius*radius*3.1416;
  23.    }
  24. };
  25.  
  26. int main()
  27. {
  28.     Circle c1;
  29.    c1.Leer();
  30.    cout<<" \n Radio : "<<c1.getRadius()<<endl;
  31.    cout<<" Area  : "<<c1.getArea()<<endl;
  32.    cout<<" Color : "<<c1.getColor()<<endl;
  33.    getch();
  34.     return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment