I'm having a hard time coming up with a way to check to see if values gathered from cin days (1-31) and months (1-12) can be checked via a bool function.
Here's a snippet of my code..
#include <iostream>
using namespace std;
void PrintTitle();
void GetDate(int&, int&, int&);
bool ValidDate(int, int, int);
int DaysInMonth(int);
int ZellersNumber(int, int, int);
void DayToString(int);
int main()
{
int month, day, year;
int x;
PrintTitle();
GetDate(month, day, year);
x = ZellersNumber(month, day, year);
DayToString(x);
return 0;
}
void PrintTitle()
{
cout << "Zeller's Number Algorithm" << endl;
}
void GetDate(int& M, int& D, int& Y)
{
cout << endl << "Enter the Month: ";
cin >> M;
cout << "Enter the Day: ";
cin >> D;
cout << "Enter the Year: ";
cin >> Y;
}
bool ValidDate(int M, int D, int Y)
{
if (! (1<= M && M<=12))
return false;
}
It obviously needs more work, but any help is appreciated.