-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
ex7_41_sales_data_test.cpp
48 lines (42 loc) · 1.11 KB
/
ex7_41_sales_data_test.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
43
44
45
46
47
48
#include "ex7_41_sales_data.h"
using std::cout;
using std::endl;
int main()
{
cout << "1. default way: " << endl;
cout << "----------------" << endl;
Sales_data s1;
cout << "\n2. use std::string as parameter: " << endl;
cout << "----------------" << endl;
Sales_data s2("CPP-Primer-5th");
cout << "\n3. complete parameters: " << endl;
cout << "----------------" << endl;
Sales_data s3("CPP-Primer-5th", 3, 25.8);
cout << "\n4. use istream as parameter: " << endl;
cout << "----------------" << endl;
Sales_data s4(std::cin);
return 0;
}
// print
/*
* 1. default way:
* ----------------
* Sales_data(const std::string&, unsigned, double)
* Sales_data()
*
* 2. use std::string as parameter:
* ----------------
* Sales_data(const std::string&, unsigned, double)
* Sales_data(const std::string&)
*
* 3. complete parameters:
* ----------------
* Sales_data(const std::string&, unsigned, double)
*
* 4. use istream as parameter:
* ----------------
* Sales_data(const std::string&, unsigned, double)
* Sales_data()
* Sales_data(istream &is)
*
*/