lewashby 56 Junior Poster

I have been instructed by my instructor to write a pseudocode date program. The program need to accept a date by looking at the year, then the month, and the day as well as to account for leap year. Please do not hesitate to help me out here, it's a private instructor, tutor, mentor, what have you, not a standard school and he's doing it for free. Any way, take a look below to see what I first wrote.

Table A = Month/day table Common year
Table B = Month/day table Leap Year

Is the year received a positive number greater than 0? If yes continue, if No wait for a valid number.

Is the month a positive number that is less than 13? if Yes continue, If No wait for a valid number.
Get leap year

Is the year leap year?

Is the remainder of the year divided by 400 0? If Yes leap year = true
Is the remainder of the year divided by 100 0? If Yes leap year = false
Is the remainder of the year divided by 4 is 0?  If Yes leap year = true
otherwise leap year = false


If leap year, does the day match the corresponding value of the month in table B? If yes continue, If No wait for valid number.

If not leap year, does day match the corresponding value of the month in table A? If yes continue, If No wait for valid number.

Here's what he sent me back.

A few observations:
> If No wait for valid number.
You are not 'waiting' for anything.
You get a number, you spit a banana.
'waiting' is ballgame on its own right.
Stick to 'KISS' 

> Table B = Month/day table Leap Year
Will you create a table with every 'leap year' in the known Universe?
Hard to believe... 

So:
1.- Please show me the contents of the tables. 

2.- Please rephrase your process as:
Read numbers -> MM/DD/YYYY
Is DD > 0 && MM > 0 and YYYY > 0
NO => BAD DATE, Exit.
YES:
... keep on ticking. ...
ET 

PS: Good job... :) 

Now I am a little confused. Fist I dont really know what's so bad about waiting for a good number. Secondly, Will I create a table with every leap year in the known universe, well, I see where that might be a little far fetched. But if that's far fetched how is it that I'M then asked to show the contents of the table? If refering to a table that has all the leap years in the known universe is absured, then showing the contents of such a table would be that much more absured. I don't want you to write the pseudocode for me I just don't understand how I should be aproaching a calender.