View Single Post
Old Jan 11th, 2007, 12:41 AM   #2
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
You don't say what you're stuck about. You can easily think of ways to validate the user's input. Certain months have 30 days, others have 31, and ol' February needs to know the year mod 4, mod 100, and mod 400 to reasonably determine the leap year situation.

As far as determining the day of the week, look up Zeller's congruence. Of course, if you have libraries, and you do, the time functions will do that for you. It's helpful if you're ever programming on a bare-bones system, though.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote