-
Notifications
You must be signed in to change notification settings - Fork 0
/
driver.cpp
62 lines (45 loc) · 1.17 KB
/
driver.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
49
50
51
52
53
54
55
56
57
58
59
60
61
#include <fstream>
#include <iostream>
#include "business.h"
using namespace std;
int main() {
// // create file object infile and open it
// // for testing, call your data file something appropriate, e.g., data2.txt
// ifstream movieFile("src/data4movies.txt");
// if (!movieFile) {
// cout << "Movie file could not be opened." << endl;
// return 1;
// }
//
// ifstream custFile("src/data4customers.txt");
// if (!custFile) {
// cout << "Customers file could not be opened." << endl;
// return 1;
// }
//
// ifstream comFile("src/data4commands.txt");
// if (!comFile) {
// cout << "Commands file could not be opened." << endl;
// return 1;
// }
ifstream movieFile("data4movies.txt");
if (!movieFile) {
cout << "Movie file could not be opened." << endl;
return 1;
}
ifstream custFile("data4customers.txt");
if (!custFile) {
cout << "Customers file could not be opened." << endl;
return 1;
}
ifstream comFile("data4commands.txt");
if (!comFile) {
cout << "Commands file could not be opened." << endl;
return 1;
}
Business store;
store.buildMovies(movieFile);
store.buildCustomers(custFile);
store.processTransactions(comFile);
return 0;
}