class point {
private:
string mytype;
int x;
public:
point()
{
int getx()const{cout<<"point ::getx()const";return 10;}//statement A
int getx() {cout<<"point ::getx()"; return x;}//statement B
virtual string isa()const{return "point";} //statement c
};
class circle:protected point
{
public:
circle():point ()
virtual string isa() const{return "circle";} //statement D
void setr(int y=200){r=y;};
protected:
int getr()const {cout<<"\n circle::getr()"; return r;}
private:
int r;
};
answer the following
a)what is the relationships between "statement C"and "statement D"?
b)what is the relationships between "statement A"and "statement B"?
c)what is the relationships between point and circle classes?
d)what is the relationships between point and mytype classes?
The answer to the question is available in the PDF file https://www.assignmentexpert.com/https://www.assignmentexpert.com/homework-answers/programming-answer-58468.pdf
Comments
Leave a comment