Days of the week program

I am in a computer science class at LSU and i can not figure out how to writhe this program. The program must let the user input (MM/DD/YYYY) and then output what day that date was on and also if it was a leap year or not. PLEASE HELP!!!!
for the leap year part
1
2
3
4
5
}
	if (!(Year2%100 == 0))
		cout << "  It is a leap year\n";
	if (!(Year2%4==0) && (Year2%400==0))
		cout << "  It is not a leap year\n";

http://en.wikipedia.org/wiki/Determination_of_the_day_of_the_week for the day of the week algorithim similar to above but just more complex.

Also for the input I started like this not sure if best way
1
2
3
4
5
6
char month[5], day[5], year[7];
	int Month,Day,Year,Year2;
	cout << "Enter month day and year in MM/DD/YYYY format\n";
	cin.get(month,4, '/');
	cin.ignore();
	Month = atoi (month);

Last edited on
Topic archived. No new replies allowed.