Class that holds Course information
Dependents: Course_Example course_input class_finder
Diff: Course.cpp
- Revision:
- 5:7d792c9848bb
- Parent:
- 4:bc4b05dacca3
- Child:
- 6:f231ecc9b944
--- a/Course.cpp Wed Dec 07 17:57:11 2016 +0000 +++ b/Course.cpp Wed Dec 07 22:23:17 2016 +0000 @@ -1,7 +1,7 @@ #include "Course.h" -#include <string> +//#include <string> -map<string, float> create_lat_map() { +/*map<string, float> create_lat_map() { map<string, float> m; m["CLH"] = 33.774801; m["COC"] = 33.777442; @@ -26,18 +26,40 @@ m["KLS"] = "Klaus"; m["VAN"] = "VanLeer"; 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(); +//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) { + + if (pAbbreviatedName == "CLH") { + fullName = "Clough"; + latitude = 33.774801; + longitude = -84.396376; + } + else if (pAbbreviatedName == "COC") { + fullName = "CoC"; + latitude = 33.777442; + longitude = -84.397259; + } + else if (pAbbreviatedName == "KLS") { + fullName = "Klaus"; + latitude = 33.777244; + longitude = -84.396256; + } + else if (pAbbreviatedName == "VAN") { + fullName = "VanLeer"; + latitude = 33.776000; + longitude = -84.397132; + } + //createBuildingMaps(); abbreviatedName = pAbbreviatedName; - fullName = buildingNames[pAbbreviatedName]; - latitude = buildingLAT[pAbbreviatedName]; - longitude = buildingLONG[pAbbreviatedName]; + //fullName = buildingNames[pAbbreviatedName]; + //latitude = buildingLAT[pAbbreviatedName]; + //longitude = buildingLONG[pAbbreviatedName]; ampm = pAMPM; hour = pHour; minute = pMinute; @@ -62,17 +84,17 @@ return hour; } -string Course :: getHour_toString() { - char hourBuf[3]; - sprintf(hourBuf, "%i", hour); - hourBuf[2] = '\0'; +string Course :: getMinute_toString() { + char minuteBuf[3]; + sprintf(minuteBuf, "%i", minute); + minuteBuf[2] = '\0'; - string hourStr = hourBuf; + string minuteStr = minuteBuf; - if (this->getHour() < 10) - hourStr = "0" + hourStr; + if (this->getMinute() < 10) + minuteStr = "0" + minuteStr; - return hourStr; + return minuteStr; } int Course :: getMinute() {