forked from COP3530/P2-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
88 lines (74 loc) · 2.39 KB
/
main.cpp
File metadata and controls
88 lines (74 loc) · 2.39 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include "parsingCSV.h"
#include "hashTable.h"
#include "toolbox.h"
#include <ctime>
#include <bits/stdc++.h>
#include "gui.h"
using namespace std;
//group 50: Julio Arboleda, Carmen Cruz Arana, Graciela Strand
int main() {
gui();
hashMapLinear linearMap(10);
parseCSV(linearMap);
hashMapChaining chainMap(10);
parseCSV(chainMap);
compareMaps(linearMap,chainMap);
priority_queue<pair<int, string>> maxPop;
priority_queue<pair<int, string>> maxDen;
priority_queue<pair<int, string>> maxSize;
priority_queue<pair<int, string>> maxAge;
cout << "Welcome to CITY SEARCHER!\nThis program will generate numerical demographic information for a US city!"<< endl;
cout << "What is your name?" << endl;
string userName;
getline(cin, userName, '\n');
cout << "Hi there " << userName << "!\n" << endl;
int iteration = 1;
string cityName;
string option;
string menu_option;
string city;
while(true)
{
if (iteration == 1){
cout << "Input the name of the city (please capitalize, e.g., \"Los Angeles\"):" << endl;
getline(cin, cityName, '\n');
searchCity(chainMap, cityName, maxPop, maxDen, maxSize, maxAge);
}
else{
menu_option = menu();
if(menu_option == "1")
{
cout << endl;
cout << "Input the name of the city: " << endl;
getline(cin, cityName, '\n');
searchCity(chainMap, cityName, maxPop, maxDen, maxSize, maxAge);
//compareMaps(cityName, linearMap, chainMap);
}
else if(menu_option == "2")
{
cout << endl;
cout << "1 - Rank by Population" << endl;
cout << "2 - Rank by Density" << endl;
cout << "3 - Rank by Household Size" << endl;
cout << "4 - Rank by Median Age" << endl;
getline(cin, option, '\n');
Rank(option, chainMap, maxPop, maxDen, maxSize, maxAge);
}
else if(menu_option == "3")
{
exit(1);
}
else
{
cout << "Invalid selection :(" << endl;
continue;
}
}
iteration++;
}
return 0;
};