in my program i have added validation for the month and year to be what i need. i wrote out the whole output for the if and else if for the validation. is there a way to shorten it down instead of having it copy pasted? thanks! (i'm referring to this part of the program:
if (month < 1 || month > 12)
{
cout<<endl;
cout<<"Mismatching Month/Day Values Entered"<<endl;
cout<<"Month Value Entered: "<<month<<endl;
cout<<"Day Value Entered: "<<day<<endl;
}
else if (day < 1 || day > daysInMonths[month-1])
{
cout<<endl;
cout<<"Mismatching Month/Day Values Entered"<<endl;
cout<<"Month Value Entered: "<<month<<endl;
cout<<"Day Value Entered: "<<day<<endl;
}