Hi there I have the following problem!
Please help!
class Base {
//private methods
void printMyType() {
cout << "this is base type" << endl;
}
//public methods
void printAllInfo() {
cout << "this An accout" << endl;
printMyType();
}
}; //end base class
class derived : public Base {
//private method
void printMyType() {
cout << "this is derived type" << endl;
}
//public methods
void printAllInfo() {
obileAccount::PrintAccountInfo();
printMyType();
}
}; //end derived class
Ok i have the above methods! Its an assingment so the public and private methods visabilites cannot be altered.
Now when I call the printAllInfo() from the base class it prints out the following
"this An accout"
"this is base type""this An accout"
I want to write correct the printAllInfo() method in the derived class so that
when I call it it prints
"this An accout"
"this is a derived account"
so in other words when I call the printAllInfo method in derived class the printMyType() method overwirtes the one in the base class and prints "this is a derived account"
thanks
pls help