A year with 366 days is called a leap year. A year is a leap year if it is divis
ID: 440108 • Letter: A
Question
A year with 366 days is called a leap year. A year is a leap year if it is divisible by four (for example, 1980), except that it is not a leap year if it is divisible by 100 (for example, 1900); however, it is a leap year if it is divisible by 400 (for example, 2000). There were no exceptions before the introduction of the Gregorian calendar on October 15, 1582 (1500 was a leap year). Write a program that asks the user for a year and computes whether that year is a leap year. I know how to build it, but I don't understand when it talks about the exceptions of 1582. Can someone explain this to me? Thanks.Explanation / Answer
To test for leap year 1 If the year is evenly divisible by 4, go to step 2. Otherwise, go to step 5. 2 If the year is evenly divisible by 100, go to step 3. Otherwise, go to step 4. 3 If the year is evenly divisible by 400, go to step 4. Otherwise, go to step 5. 4 The year is a leap year (it has 366 days). 5 The year is not a leap year (it has 365 days).
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.