#include <iostream>
#include <string>
int main() {
const char dash = '-' ;
const int current_year = 2019 ;
int month ;
int day ;
int year ;
char separator ;
std::cout << "Please enter your birth date (mm-dd-yyyy): " ;
if( std::cin >> month && month > 0 && month < 13 &&
std::cin >> separator && separator == dash &&
std::cin >> day && day > 0 && day < 32 &&
std::cin >> separator && separator == dash &&
std::cin >> year && year > 1800 && year <= current_year )
{
const std::string month_names[] =
{
"",
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
};
std::cout << "your birth day is in the month of " << month_names[month] << '\n' ;
}
else std::cout << "Invalid Date!\n" ;
}