-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSharePrice.cpp
43 lines (36 loc) · 982 Bytes
/
SharePrice.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// 2019, 1126, 10:00, by Queenie
// Class & Access Control & Data Hidden
class ShareMarket{
// 此處為封裝區 Encapsulation
// /
// /
// /
// /
// /
private:
char target[10];
int shares;
float share_val;
double total_val;
void know_totoal(){
total_val= shares * share_val;
}
// 實作區 (成員函數)
// /
// /
// /
// /
// /
public:
void before(const char *com, int n, double pr); //請使用建構子替代之
void buy(int shareAmount, double dealPrice);
void sell(int shareAmount, double dealPrice);
void after(double dealPrice);
void show();
// \
// \
// \
// \
// \
// 此處作抽象化處理 Abstract
};