public static int dayOfWeek(int month, int day, int year)
{
int n = dayOfYear(month, day, year); //which day of the month for example the 10th day or the 5th day
int firstDay = firstDayOfYear(year); //which day does the month start on for example tuesday would be 2 or thursday would be 4
int whichDay = (firstDay + n - 1) % 7; // ex: firstday=4 n=10 whichDay would be equal to 6 which is Saturday. Divide by 7 to find the mod to find how many days after the first day to find whichDay
return whichDay;
}