Our programmer forgot to implement something. Correct this mistake for him.
Constructors and destructors
Errors
Report a typo
Sample Input 1:
1 1Sample Output 1:
2
1
1
0Write a program in C++
class Calc {
private:
double a;
double b;
public:
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;
}
};
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.