The whole fact the user is using a console and not a Window with the proper GUI is already less convenient for both you and the user.
But since it's for practice purposes, then you'll want to work with string manipulation.
1 2 3
|
string date;
cout << "Please insert a date in this format MM/DD/YYYY";
cin >> date;
|
Nothing forbids the user to type something out of the rules, like
99-0343.12
Well, you have multiple situations to take into account.
The most obvious ones are:
1) The month is correct ( values from 1 to 12 )
2) The day is correct ( values from 1 to 31 )
3) The year is correct ( values less than or equal to the current year )
Let's say you come up with a solution to these 3 problems. Now the user can freely type
10-04/2016
You see the user entered both '-' and '/' to separate day,month and year.
You can choose to both give an error if this occurs or just to ignore them as long as the date itself is correct