Please, anyone who can help? pseudocode to display the next date of a Gregorian date given by a user considering a leap year. (just a language independent pseucode) I'm exhausted right now

1 answer

assuming you have filled in an array (call it days) of 12 elements, each with the number of days in the month,

get date (m/d/y)
split into month,day,year

if day < days[month] then
&nbrsp;&nbrsp;day++
else if month < 12 then
&nbrsp;&nbrsp;day=1
&nbrsp;&nbrsp;month++
else
&nbrsp;&nbrsp;month=1
&nbrsp;&nbrsp;day=1
&nbrsp;&nbrsp;year++
endif
display month/day/year

You can also fill an array of month names, and display monthname[month] instead of the month number.