Question: Overview In this program, you will use what you know about if-statements and modulo to determine if a given year is a leap year Objectives

Overview In this program, you will use what you know about if-statements and modulo to determine if a given year is a leap year Objectives This lab will give you practice using branching logic with if-statements modulo Description A year in the modern Gregorian Calendar consists of 365 days. In reality, the earth takes longer to rotate around the sun. To account for the difference in time, every 4 years, a leap year takes place. A leap year is when a year has 366 days. An extra day, February 29th. The two requirements for a given year to be a leap year are: 1) The year must be divisible by 4 2) If the year is a century year (1700, 1800, etc.), the year must be evenly divisible by 100 Some example leap years are 1600, 1712 and 2016 1900 is not a leap year Write a program that takes in a year and determines whether that year is a leap year. We strongly recommend you write out an algorithm to describe how to solve this in English before starting to write any code Drawing a diagram should help. Once you have the algorithm, put your code in a little at a time to make sure what you have so far is working properly, Sample run Enter year: 1954 1954 is not a leap year. Enter year: 2016 2016 is a leap year. sooks 4.13. LAB 4D: Leap Year zyBooks catalog Help/FAQ Bailey Kwa describe how to solve this in English before starting to write any code Drawing a diagram should help. Once you have the algorithm, put your code in a little at a time to make sure what you have so far is working properly. Sample run Enter year: 1954 1954 is not a leap year. Enter year: 2016 2016 is a leap year. Enter year: 1913 1913 is not a leap year. 301826 1805470 LAB ACTIVITY 4.13. 1. LAB 4D Leap Year 0/30 main.py Load default template 1 * It may make your coding easier to have a Boolean variable that keeps track of whether you've found a leap year 3 # Ask the user for the year and convert it to an integer 4 input year - int(input("Enter year:)) 6 W Type your code to determine if the rout_year is a leap year after this Tine 2 5 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
