I need HELP!!
I'm having soo much trouble writing a code for a date validation program that asks for a user to imput a date, and tell whether it's valid or not. And it also must account for leap years. I'm just getting introduced to this and nothing is going right. I'm getting real stressed out and I need some help. Can anyone help me out?
Here's a start for you, assuming you want to enter the date as mm/dd/yyyy.
Read the entire date in as a string and then use a series of if statements to determine if the date is valid. Follow these steps.
1. Check the first two elements of the array to see if they are both numeric AND within the bounds of mm.
2. Check the third element to see if it is not numeric.
3. Check the fourth and fifth elements of the array to see if they're both numeric and within the bounds of dd.
4. Check the sixth element to see if it's not numeric.
5. Check the last four elements to see if they're numeric and less than the current year.
You might also want to try converting the date into a julian date and then checking to see if it's correct.
still need help
I still can't get this to work. I'm probably just making some careless mistakes somewhere. Thanks for your advice.
Look at the code I posted in the "Overloading Constructors" thread. That checks dates & leap years.
I think my program isn't working because I'm not getting it to loop correctly. I'll keep at it.
I finally got it to work!! Thanks for the help.