Exemple #1
0
/****************************************************************
 *bool ValidateDate(unsigned short month,
					  unsigned short day,
					  unsigned short year) const;

 * utility; Checks to see if the date is valid
 * Parameters: unsigned short month //month
 *             unsigned short day   //day
 *             unsigned short year  //year
 * Return: t/f depending on if date is valid
 ***************************************************************/
bool Date::ValidateDate(unsigned short month, unsigned short day,
		unsigned short year) const
{

	return(ValidateMonth(month) &&
			ValidateDay(month, day, year) &&
			ValidateYear(year));
}
Exemple #2
0
/*************************************************************************
 *  used to get the date from the user and use the validate methods to
 *  check if the input is valid
 * _______________________________________________________________________
 * month
 * day
 * year
 * _______________________________________________________________________
 * returns nothing
 *************************************************************************/
void Date::GetDate(unsigned short &month, unsigned short &day, unsigned short &year)
{
//	cout << "enter the month: ";
//	cin >> month;
//	cin.ignore(1000,'\n');
//	cout << "enter the day: ";
//	cin >> day;
//	cin.ignore(1000,'\n');
//	cout << "enter the year: ";
//	cin >> year;
//	cin.ignore(1000,'\n');

    ValidateYear(year);
    ValidateMonth(month);
    ValidateDay(month, day, year);
    ValidateDate(month, day, year);


}