You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
597 B
C++

8 years ago
#include <iostream>
#include "calc_client.h"
8 years ago
int main() {
CalcClient calc;
8 years ago
double x = 1.0;
double y = 2.0;
double result = 0.0;
if (calc.Add(x, y, &result)) {
printf("add: %.1f\n", result);
}
if (calc.Subtract(x, y, &result)) {
printf("subtract: %.1f\n", result);
}
if (calc.Multiply(x, y, &result)) {
printf("multiply: %.1f\n", result);
}
if (calc.Divide(x, y, &result)) {
printf("divide: %.1f\n", result);
8 years ago
}
7 years ago
// Try to call a non-existing operation.
if (calc.NotExist(x, y, &result)) {
printf("notexist: %.1f\n", result);
}
8 years ago
return 0;
}