Class that holds Course information
Dependents: Course_Example course_input class_finder
Diff: Course.cpp
- Revision:
- 4:bc4b05dacca3
- Parent:
- 3:e2024ec77d96
- Child:
- 5:7d792c9848bb
diff -r e2024ec77d96 -r bc4b05dacca3 Course.cpp --- a/Course.cpp Wed Dec 07 02:03:35 2016 +0000 +++ b/Course.cpp Wed Dec 07 17:57:11 2016 +0000 @@ -24,7 +24,7 @@ m["CLH"] = "Clough"; m["COC"] = "CoC"; m["KLS"] = "Klaus"; - m["VAN"] = "Van Leer"; + m["VAN"] = "VanLeer"; return m; } @@ -62,6 +62,19 @@ return hour; } +string Course :: getHour_toString() { + char hourBuf[3]; + sprintf(hourBuf, "%i", hour); + hourBuf[2] = '\0'; + + string hourStr = hourBuf; + + if (this->getHour() < 10) + hourStr = "0" + hourStr; + + return hourStr; +} + int Course :: getMinute() { return minute; } @@ -120,7 +133,7 @@ minuteStr = "0" + minuteStr; } - output = this->getFullName() + " at " + hourStr + ":" + minuteStr + " " + this->getAMPM(); + output = this->getFullName() + " at " + hourStr + ":" + minuteStr + "" + this->getAMPM(); return output; } /*