Question: You are given a file containing 5000 dates. (Create a text file with extension .txt containing some dates) Your task is, for each date, print

You are given a file containing 5000 dates. (Create a text file with extension .txt containing some dates) Your task is, for each date, print valid if the date is correct. Otherwise print invalid. The months are: "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" Each month has a valid range of dates. 1-30 dates are valid for: "Apr", "Jun", "Sep", "Nov" 1-31 dates are valid for: "Jan", "Mar", "May", "Jul", "Aug", "Oct", "Dec" 1-28 dates are valid for non-leap year "Feb" 1-29 dates are valid for leap year "Feb" be a leap year, the year number must be divisible by 4 - except for end-of-century (100) years ust be divisible by 400
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
