You have a basic Calc class:
class Calc {
public:
double a;
double b;
double addition() {
return a + b;
}
double multiplication() {
return a * b;
}
double division() {
if (b != 0)
return a / b;
else
std::cout << "Division by zero is not allowed." << std::endl;
}
double subtraction() {
return a - b;
}
};
You need to implement a descendant class called ExtCalc. This class should have an additional method: exponentiation. The essence of this method is that it raises the first number to the power of the second.