#include #include #include "date.h" using namespace std; int main() { for (;;) { date d; cout << "Please input a date in the format mm/dd/yyyy\n"; cin >> d; if (cin.eof()) { //The user typed control-d for end-of-file. break; } if (!cin) { cerr << "Sorry, bad input.\n"; return EXIT_FAILURE; } cout << "The date you inputted was " << d << ".\n\n"; } return EXIT_SUCCESS; //Arrive here when user typed control-d }