cis homework
You must follow the instructions closely to get this formula right. Otherwise, it will not give you the correct result. You must preced it by the code I included. Here is the body of the function I have. You need to add the header to it, and this should work fine. Test it.
if (year < 0)
return 0;
else
{
if (month < 3)
{
month += 12;
year -= 1;
}
weekDay = (day + 2*month + 3*(month+1)/5 + year +
year/4 – year/100 + year/400 + 1) % 7;
if (month > 12)
{
month -= 12;
year += 1 ;
}
}
return weekDay;