#include <iostream>
using namespace std;
class number {
private:
double n;
public:
number():n(0){}
number(double _n):n(_n){}
double square() {
return (this->n)*(this->n);
}
bool isPositive() {
return (n>0);
}
};
class positive_number : public number {
private:
double n;
public:
positive_number():n(0){}
};
int main()
{
positive_number a;
cout << a.square();
}
|