Class that holds Course information
Dependents: Course_Example course_input class_finder
Diff: Course.cpp
- Revision:
- 2:8f163dc0b6c4
- Parent:
- 1:b02713ff0bd5
- Child:
- 3:e2024ec77d96
diff -r b02713ff0bd5 -r 8f163dc0b6c4 Course.cpp --- a/Course.cpp Mon Dec 05 02:47:38 2016 +0000 +++ b/Course.cpp Wed Dec 07 01:41:40 2016 +0000 @@ -1,12 +1,39 @@ #include "Course.h" #include <string> -map<string, float> Course::buildingLAT; -map<string, float> Course::buildingLONG; -map<string, string> Course::buildingNames; +map<string, float> create_lat_map() { + map<string, float> m; + m["CLH"] = 33.774801; + m["COC"] = 33.777442; + m["KLS"] = 33.777244; + m["VAN"] = 33.776000; + return m; +} + +map<string, float> create_long_map() { + map<string, float> m; + m["CLH"] = -84.396376; + m["COC"] = -84.397259; + m["KLS"] = -84.396256; + m["VAN"] = -84.397132; + return m; +} + +map<string, string> create_names_map() { + map<string, string> m; + m["CLH"] = "Clough"; + m["COC"] = "College of Computing"; + m["KLS"] = "Klaus"; + m["VAN"] = "Van Leer"; + return m; +} + +map<string, float> Course::buildingLAT = create_lat_map(); +map<string, float> Course::buildingLONG = create_long_map(); +map<string, string> Course::buildingNames = create_names_map(); Course :: Course(string pAbbreviatedName, int pHour, int pMinute, string pAMPM) { - createBuildingMaps(); + //createBuildingMaps(); abbreviatedName = pAbbreviatedName; fullName = buildingNames[pAbbreviatedName]; latitude = buildingLAT[pAbbreviatedName]; @@ -28,6 +55,13 @@ return hour; } +int Course :: getHour_forCompare() { + if (hour == 12) + return 0; + else + return 1; +} + int Course :: getMinute() { return minute; } @@ -89,7 +123,7 @@ output = this->getFullName() + " at " + hourStr + ":" + minuteStr + " " + this->getAMPM(); return output; } - +/* void Course :: createBuildingMaps() { buildingLAT["ALN"] = 33.776078; buildingLONG["ALN"] = -84.398785; buildingNames["ALN"] = "Allen"; @@ -135,4 +169,4 @@ buildingNames["SKI"] = "Skiles"; buildingLAT["VAN"] = 33.776000; buildingLONG["VAN"] = -84.397132; buildingNames["VAN"] = "Van Leer"; -} \ No newline at end of file +}*/ \ No newline at end of file