Question: #include #include #include #include #include #include #include #include #include #include #include using namespace std; int month = 0, year = 0; char separator; int main()

#include #include #include #include #include #include #include #include #include #include #include using namespace std; int month = 0, year = 0; char separator; int main() { DATE: do { cout << "Please enter card expiration date in (mm/yy) format: "; while (!(cin >> month >> separator && separator == '/' && cin >> year)) { cout << "Please enter in format(yy/mm) "; cin.clear(); #undef max cin.ignore(numeric_limits::max(), ' '); if (cin >> month >> separator && separator == '/' && cin >> year) { if (month <= 0 || month > 12) { cout << "Invalid Month!" << endl; cout << endl; goto DATE; } } } } while (!(month > 0 && month == 12)); system("pause"); return 0; } How do I correct this coding?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!