@alexey31415
59 / 59 / 3
Регистрация: 16.05.2010
Сообщений: 632
|
01.09.2012, 21:37
[ТС]
|
|
класс Subscriber
C++ | 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
| class Subscriber
{
friend class Call;
friend class Date;
public:
Subscriber
(
vector<int> subscriber_number,
string subscriber
);
//функции для работы с абонентом
//----------------
bool AddNewCall();
bool PrintCalls();
bool DeleteCall();
bool SaveCalls();
//----------------
//функции для проверки введённых данных
//-----------------------------------------------------
bool CorrectNumber(const vector<int> &number);
bool CorrectDate(const Date &start,const Date &finish);
//-----------------------------------------------------
bool SetLastCostAdd();
//функции для определения параметров звонка
//-----------------------------------------
bool IsInsideHomeNetwork(const vector<int> &number);
Date CalculateFreeMinutes
(
const Date &call_start,//
bool IsOutgoing,//
bool inside_home_network,//
const Date &duration//
);
//-----------------------------------------
private:
vector<int> _subscriber_number;//
string _subscriber;//
vector<Call> _calls;//
Date LastCreditAdd;//
Date LastWeekend;//
Date free_minutes_in_home_network;//
Date free_minutes_on_weekend;//
static double _connection_fee;//
static double _cost_inside_home_network;//
static double _cost_outside_home_network;//
static vector<vector<int>> _home_network_prefixes;//
}; |
|
реализация
C++ | 1
2
3
4
5
6
| int _prefix[3] = {0,9,5};
vector<int> prefix(_prefix,_prefix + 3);
vector<vector<int>> Subscriber::_home_network_prefixes.push_back(prefix); |
|
0
|