OJ's rants

It's not about you, it's about the software

Challenge #3 - Day of Birth

| Comments

I haven’t posted a challenge for a while, so I thought I’d get you all thinking again with another basic little program. It’s simple, but there are a stack of possible solutions, so I’m expecting a bit of variety. So here we go.

Write a program that asks the user for their date of birth using the date format YYYY-MM-DD (eg. 1978-12-05 in my case). The program should respond by telling the user what day of the week they were born on.

You’re allowed to use any language you want, but you’re not allowed to use the built-in date object functionality other than to determine the current system date. That is, you can’t date difference functions to determine time that’s passed. You have to figure that out for yourself.

For those C# coders, don’t even think about posting: dateOfBirth.Day :) You’re supposed to do the hard bit yourself

Anyway, it’s easy peasy :) Don’t forget about leap years and stuff! I look forward to seeing your answers. I’ll post up a solution in a week or so. Let me know if I haven’t been clear.

Comments