Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream.h>
- #include<conio.h>
- #include<string>
- class Circle{
- private:
- double radius; //mienbro dato(variable)
- string color;
- public:
- void Leer() //funcion mienbro
- {
- cout<<"Radio : ";cin>>radius;
- cout<<"Color : ";cin>>color;
- }
- double getRadius(){ //funcion mienbro(getter)
- return radius;
- }
- string getColor(){
- return color;
- }
- double getArea(){
- return radius*radius*3.1416;
- }
- };
- int main()
- {
- Circle c1;
- c1.Leer();
- cout<<" \n Radio : "<<c1.getRadius()<<endl;
- cout<<" Area : "<<c1.getArea()<<endl;
- cout<<" Color : "<<c1.getColor()<<endl;
- getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment