In: Computer Science
Class object in C++ programming language description about lesson inheritance example.
#include
#include
#include
#include
using namespace std;
class shap{
protected:
int x,y;
public:
shap(int xx, int yy)
:x(xx),y(yy){}
void setx(int xx){
x=xx;
}
void sety(int yy){
y=yy;
}
int getx(int xx)const{
return xx;
}
int gety(int yy)const{
return yy;
}
};
class circle: public shap{
protected:
float r;
public:
circle(int xx,int yy)
:shap(xx,yy){}
float area_cir(float ar){
ar=r*r*3.14;
return (ar);
}
void input_cir(){
float ra;
r=ra;
cout<