#include<iostream>
#include<string>
#include<conio.h>
#include<limits>
#include<Windows.h>
#include<fstream>
#include <cstdlib>
#include<cctype>
#include<set>
#include<string>
#include<chrono>
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<streamsize>::max(), ‘n’);
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?
Expert Answer
An answer will be send to you shortly. . . . .