Question: Write a program that validates a date input by the user. The program should ask for the year, the month number (1 for January, 2

Write a program that validates a date input by the user. The program should ask for the year, the month number (1 for January, 2 for February, and so on), and the day of the month. Use a function Valid_Date () that takes three argumentsthe year, the month number, and the day to validate the date. The function should validate the date as follows. The day must be greater than 0 and must not exceed the correct number of days in the month. (Remember to check for leap yeara year that is divisible by 4in which February has 29 days.) The month number must be between 1 and 12. The year must not be less than 1900 nor greater than 2100. If the date is valid, Valid_Date () should return 1; otherwise, it should return 0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!