回答編集履歴
1
修正
test
CHANGED
@@ -1,13 +1,43 @@
|
|
1
|
+
newcalc.h:
|
2
|
+
|
1
3
|
```C++
|
4
|
+
|
5
|
+
#ifndef NEWCALC_H__
|
6
|
+
|
7
|
+
#define NEWCALC_H__
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
#include "fundcalc.h"
|
12
|
+
|
13
|
+
|
2
14
|
|
3
15
|
class NewCalc : public FundCalc {
|
4
16
|
|
5
17
|
public:
|
6
18
|
|
7
|
-
double mul()
|
19
|
+
double mul();
|
8
20
|
|
9
|
-
double div()
|
21
|
+
double div();
|
10
22
|
|
11
23
|
};
|
12
24
|
|
25
|
+
#endif
|
26
|
+
|
13
27
|
```
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
newcalc.cpp:
|
32
|
+
|
33
|
+
```C++
|
34
|
+
|
35
|
+
#include "newcalc.h"
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
double NewCalc::mul() { return getNumber1() * getNumber2(); }
|
40
|
+
|
41
|
+
double NewCalc::div() { return getNumber1() / getNumber2(); }
|
42
|
+
|
43
|
+
```
|