Commit 7c040dd6 authored by Elon Bontemps's avatar Elon Bontemps
Browse files

autosave

parents cd0cc8c1 37773ebd
......@@ -7,14 +7,17 @@
using namespace std;
//function returns map of pairs
map<string, pair<double, double>> mapMaker() {
pair<double, double> longAndLat () {
ifstream fin;
fin.open("countries.txt");
//cout << "What city/country are you from/closest to: "
ifstream filestream("countries.txt");
print("Print this", filestream);
//variables
map<string, pair<double, double>> tempMap;
pair<double,double> tempPair;
vector <pair<double, double>> coordinateVector;
map<string, pair<double, double>> tempMap();
string placeName;
int cityNum;
if(!fin.is_open()) {
cerr << "Error couldn't open file." << endl;
......@@ -22,13 +25,37 @@ map<string, pair<double, double>> mapMaker() {
}
while(!fin.eof()) {
pair<double,double> tempPair;
getline(fin, placeName, '.');
getline(fin, tempPair.first, '.');
getline(fin, tempPair.second, '\n');
coordinateVector.push_back(tempPair); //ads latitudes and longitutes to coordinate vector
tempMap.emplace(placeName, tempPair);
placeName.clear();
}
//<<<<<<< HEAD
return tempMap;
}
//output the country.txt file onto the system
//give eric the specific line the user chooses in the text file and give just coordimnates
//=======
// TODO Print the cities
do {
cout << "Which city do you live in/live near?: ";
if (!(cin >> cityNum)) { // validates that numbers were entered and checks input
cerr << "Error! Please enter a valid integar." << endl;
cin.clear();
cin.ignore(1000, '\n');
continue;
}
if (cityNum > 0 && cityNum < 40) {
break;
} else {
cerr << "Error! Invalid year. Please enter a year between 1 and 9099" << endl;
}
} while (true);
return coordinateVector.at(cityNum - 1);
}
//>>>>>>> 37773ebd81c48909890df464721d8b1870634f96
This diff is collapsed.
......@@ -20,4 +20,7 @@ Who does what (tentative):
- orbital models (visual aid) (Elizabeth)
- Pass user input to algorithm (Brandon and Moses)
- User interface (Elon)
- Algorithm (Eric)
\ No newline at end of file
- Algorithm (Eric)
-
The project that Eric, Brandon
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment