-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapplication.cpp
More file actions
71 lines (66 loc) · 2.73 KB
/
application.cpp
File metadata and controls
71 lines (66 loc) · 2.73 KB
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
62
63
64
65
66
67
68
69
70
71
#include <iostream>
#include <fstream>
#include <sstream>
#include <map>
#include "barchartanimate.h"
using namespace std;
int main() {
string CYAN("\033[1;36m");
string GREEN("\033[1;32m");
string GOLD("\033[1;33m");
string RED("\033[1;31m");
string PURPLE("\033[1;35m");
string BLUE("\033[1;34m");
string WHITE("\033[1;37m");
cout << " " <<GOLD<<"⛤"<<RESET<<" -----" << endl;
cout << " " <<GOLD<<"⛤"<<RESET<<" / \\" << endl;
cout << " | |" << endl;
cout << " \\ /" << endl;
cout << " -----" << endl;
cout << PURPLE << "|----| "<<GOLD<<" | | ||"<<PURPLE<<" |----|" << endl;
cout << PURPLE << "|----| "<<GOLD<<" | | ||"<<PURPLE<<" |----|" << endl;
cout << "|----| |------| |------| |----|" << endl;
cout << "|----| |------| |------| |----|" << endl;
cout << "|----| |------| City Popularity Simulator |------| |----|" << endl;
cout << "|----| |------| |------| |----|" << endl;
cout << "|----| |------| |------| |----|" << endl;
cout << "|----| |------| |------| |----|" << endl;
cout << "|----| |------|"<<BLUE<<",_,_,_,_,_,_,_,_,_,_,_,_,_,"<< PURPLE <<"|------| |----|" <<BLUE<<",_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_," << endl;
cout << RESET << "Enter file name: " << endl;
string filename;
cin >> filename;
ifstream inFile(filename);
string title;
getline(inFile, title);
string xlabel;
getline(inFile, xlabel);
string source;
getline(inFile, source);
BarChartAnimate bca(title, xlabel, source);
while (!inFile.eof()) {
bca.addFrame(inFile);
}
string userChoice;
string fromYear;
string toYear;
cout << "1. Choose time frame " << endl;
cout << "2. View full animation" << endl;
cin >> userChoice;
// ask user what time frame? Based on the map made in barchartanimate
// we have to first make a function that retieves this map
if (userChoice == "1") {
map<string, int> theFrameMap = bca.getFrameMap();
for (auto& m : theFrameMap) {
cout << m.first << " " << m.second << endl;
}
cout << "From: " << endl;
cin >> fromYear;
cout << "To: " << endl;
cin >> toYear;
bca.animateTwo(cout, 12, fromYear, toYear);
}
else if (userChoice == "2") {
bca.animate(cout, 12, -1);
}
return 0;
}