-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathname_creator.cpp
More file actions
31 lines (27 loc) · 871 Bytes
/
Copy pathname_creator.cpp
File metadata and controls
31 lines (27 loc) · 871 Bytes
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
// name_creator.cpp
#include <string>
#include <iostream>
std::string CreateLocName(float lat, std::string ns, float lon, std::string ew,std::string name)
{
// float sign_adjusted_lat;
if (lat<0)
{
lat *= -1.0;
}
if (lon <0)
{
lon *= -1.0;
}
std::string full_info;
full_info = std::to_string(lat) + ns + " " + std::to_string(lon)
+ ew + " ("+name+")";
return full_info;
}
int CreateOutputResult(std::string start,std::string min,std::string max,
float min_dis, float max_dis)
{
std::cout << "Start Location: " << start << std::endl;
std::cout << "Closest Location: " << min << " (" << std::to_string(min_dis) << " miles)" << std::endl;
std::cout << "Farthest Location: " << max << " (" << std::to_string(max_dis) << " miles)" << std::endl;
return 0;
}