Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
P
Project 3 Star Gazing
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Eric Walsh
Project 3 Star Gazing
Commits
7c040dd6
Commit
7c040dd6
authored
Mar 19, 2019
by
Elon Bontemps
Browse files
Options
Browse Files
Download
Plain Diff
autosave
parents
cd0cc8c1
37773ebd
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
352 additions
and
198 deletions
+352
-198
Countries/countries.cpp
Countries/countries.cpp
+34
-7
Input stuff/Functions.cpp
Input stuff/Functions.cpp
+314
-190
README.md
README.md
+4
-1
Star Array/Coordinates.txt
Star Array/Coordinates.txt
+0
-0
No files found.
Countries/countries.cpp
View file @
7c040dd6
...
...
@@ -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
Input stuff/Functions.cpp
View file @
7c040dd6
This diff is collapsed.
Click to expand it.
README.md
View file @
7c040dd6
...
...
@@ -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
Star Array/Coordinates.txt
deleted
100644 → 0
View file @
cd0cc8c1
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment