#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"; //------------------------------------------------------------------ if ( hour < 12) { cout << "Good Morning!\n"; } else if ( hour < 12 + 6) { cout << "Good Afternoon!\n"; } else { cout << "Good Evening!\n"; } return EXIT_SUCCESS; //------------------------------------------------------------------- //Add your new code under this horizontal line. //Do not attempt to connect your new "if" with the "if"s above. return EXIT_SUCCESS; }