Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Lab Seven Date Validation.. One of the hardest parts of programming is deoling with the users. They do erratic things despite all your best wornings

image text in transcribed
Lab Seven Date Validation.. One of the hardest parts of programming is deoling with the users. They do erratic things despite all your best wornings and error messages. One of the areas where users are the worst dates For practice- I want you to write a rather incomplete program. All you have to do is ask the user what month, day and year they want to leave on. The challenge is thot you must make sure that is indeed a real date. Use this old poem as your guide Thirty days hath September April, June, and November All the rest have thirty-one, Save February, with twenty-eight days clear, And twenty-nine eoch leap year There is one catch- you must be prepared for a leap year. Leap year is a year when an extra day is added to February to keep the whole sunshine-during-the-day thing in wack. If a year is a jeap year, there will be a February 29 How do you know if it is a leap year? Test it as follows Every year that is evenly divisible by four is a leap year Except- if it can be evenly divided by 100, it is NOT a leap year .Unless the year is evenly divisible by 400, then it is a leap year All you need to tell the user - date does not exist or valid date. Additional Requirements: Use your own judgment to determine how you want to handle month input-as a . string or an integer. However, make it really clear to me how I'm supposed to enter it! . Test it! Test it! Test it! Deliberately put in bad dates to see if you program notifies me! Lab Seven Date Validation.. One of the hardest parts of programming is deoling with the users. They do erratic things despite all your best wornings and error messages. One of the areas where users are the worst dates For practice- I want you to write a rather incomplete program. All you have to do is ask the user what month, day and year they want to leave on. The challenge is thot you must make sure that is indeed a real date. Use this old poem as your guide Thirty days hath September April, June, and November All the rest have thirty-one, Save February, with twenty-eight days clear, And twenty-nine eoch leap year There is one catch- you must be prepared for a leap year. Leap year is a year when an extra day is added to February to keep the whole sunshine-during-the-day thing in wack. If a year is a jeap year, there will be a February 29 How do you know if it is a leap year? Test it as follows Every year that is evenly divisible by four is a leap year Except- if it can be evenly divided by 100, it is NOT a leap year .Unless the year is evenly divisible by 400, then it is a leap year All you need to tell the user - date does not exist or valid date. Additional Requirements: Use your own judgment to determine how you want to handle month input-as a . string or an integer. However, make it really clear to me how I'm supposed to enter it! . Test it! Test it! Test it! Deliberately put in bad dates to see if you program notifies me

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions