Wednesday, 18 September 2013

C++ Data Validation Issue

C++ Data Validation Issue

if (month > 0 && month <= 12)
if (day > 0 && day <= checkDays(month, year))
if (year >= 1752 || year <= 9999)
if((month != 12 && day != 31 && year != 9999))
return true;
else return false;
else return false;
else return false;
else return false;
I have the values month = 12, days = 31, and year = 2008 and the data
validation is failing at the last part, but I cannot figure out why.

No comments:

Post a Comment