C++ Programming, how do i set a range of acceptable numbers?

I'm trying to get a little bit of my C++ homework done and for the life of me I can't figure out exactly how to set a range of numbers for this problem. I have to set acceptable year entry 1600 - 2200 and check the numbers to make sure its a valid date. Heres my code thus far. #include... show more I'm trying to get a little bit of my C++ homework done and for the life of me I can't figure out exactly how to set a range of numbers for this problem. I have to set acceptable year entry 1600 - 2200 and check the numbers to make sure its a valid date.

Heres my code thus far.

#include <iostream>
using namespace std;

bool leapYear(int y)
{
return ( y % 100 != 0 && y % 4 == 0 ) || ( y % 400 == 0 );
}//leapYear
bool value data (int day,int month,int year)
{
check your range - return false
check month 1-12mo return false
check months 31days return false
check months 30days, inc return false
if feb + Ly + not (1-29, inc)
if feb + NotLy + not (1-28, inc) return false
return true
}//end
int main()
{
int day, month, year;
double myear;
char magic;

cout << endl;
cout << " Is your date magic? " << endl;
cout << " -------------------" << endl << endl;

cout << "Please enter the month: ";
cin >> month;

cout << "Please enter the day: ";
cin >> day;

cout << "Please enter the year (in 4 number format): ";
cin >> year;

bool leapYear (year);
bool value data(a,day,year);

if (validDate(1-1-1600))
{
myear = year % 100;

if ( month * day == myear )
cout << "Your date is magic! " << endl << endl;
else if ( month * day != myear )
cout << "I'm sorry.. your date isn't magic. " << endl << endl;
}
else
{
cout << " The date " << month << "/" << day << "/" << year << " is a INVALID date. " << endl;
}
system ("pause");
return 0;
} //end of main

Any help would be greatly appreciated!
Update: @ Michael - Is there anyway you could simplify that a little bit? I'm fairly new to programming and that makes my head hurt, not to mention I've yet to go over strings in details so I dont really understand the programming enough to learn from what you wrote.
3 answers 3