#include #include #include // for the functions time and localtime using namespace std; int main() { // Get the current hour of the day (0 to 23 inclusive). time_t t {time(nullptr)}; tm *p {localtime(&t)}; int hour {p->tm_hour}; cout << "On a 24-hour clock, the current hour is " << hour << ".\n"; cout << "On a 12-hour clock, the current hour is "; if (hour == 0) { cout << 12; // midnight } else if (hour <= 12) { cout << hour; // before and including noon } else { cout << hour - 12; // after noon } if (hour < 12) { cout << " a.m."; } else { cout << " p.m."; } cout << "\n"; //------------------------------------------------------------------- // Add your new code under this horizontal line. // Do not attempt to connect your new "if" with the "if"s above. if (hour >= 5 && hour < 12) { cout << "Good morning!\n"; } else if (hour >= 12 && hour < 17) { cout << "Good afternoon!\n"; } else { cout << "Good evening!\n"; } return EXIT_SUCCESS; }