we are given an algorithm
a=(14-month)/12;
y=year-a;
m= month+12*a-2;
startday=(day+y+y/4-y/100 + y/400 + (31*m/12))%7;
I think I understand the concept but i cannot make this work
this is what i have so far
We are also suppose to put the program in another file but I commented all that out until i actually have the program down.
void calendar(const int month, const int startday, const bool leap);
int daysofmonth [13]= {0,31,28,31,30,31,30,31,31,30,31,30,31};
const string STRMONTHS[13] = {" ", "Janurary", "February","March","April","May","June","July","August","September","October","November","December"};
int inputyear(void)
{
int year;
cout << "Enter a 4 digit year greater than 1582: ";//finds year user wants
cin >> year;
while (year < 1582 || year > 9999)
{
cout << "Invalid, Please enter a year greater than 1582 and less than 9999: ";
cin >> year;
}
return year;
}
void printmonthname (const int M, ostream & mf)//Spaces the month names out
{
int width = 14+(STRMONTHS[M].length()/2);
mf<<setw(width) << STRMONTHS[M] << endl;
int determinedaycode (int year)
{
int daycode;
int a, month, y, m, day, startday;
a=(14-month)/12;
y=year-a;
m= month+12*a-2;
startday=(day+y+y/4-y/100 + y/400 + (31*m/12))%7;