Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Leap Yeair As the earth orbits around the sun, it takes 365 and one quarter days to complete an orbit. To make the adjustment for

image text in transcribed

Leap Yeair As the earth orbits around the sun, it takes 365 and one quarter days to complete an orbit. To make the adjustment for the quarter day, we add one day every 4 years to the calendar and that's the origin of the leap year. However, in so doing, there is a slight error that creeps in and to compensate for this error, years those are divisible by 100, but not by 400 are not considered leap years So, to summarize the definition of a leap year: If a number is not divisible by 4, it is not a leap year >If a number is divisible by 100 but not by 400, it is not a leap year. If a number is divisible by 100 and 400, it is a leap year > If a number is not divisible by 100 but divisible by 4, it is a leap year Examples Case i: 1991, 2001 and 2005 are not leap years. Case 2: 1800 and 1900 are not leap years. Case 3: 1600 and 2000 are leap years Case 4: 1992, 1996 and 2008 are leap years You have to write a Python script that allows user to enter a number greater that 100 as the year and print a message saying whether it is a leap year or not. Note that, if user enter a number less than or equal to 100, then your program should display an error message. Sample interfaces for the program Enter a year greater than 100 1996 1996 is a leap year! or Enter a year greater than 100: 2001 2001 is not a leap year! or Enter a year greater than 100: 90 Error: Year is less than or equals to 100

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