1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
BARSIC [14]
3 years ago
6

3.26 LAB: Leap Year A year in the modern Gregorian Calendar consists of 365 days. In reality, the earth takes longer to rotate a

round 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 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 400 Some example leap years are 1600, 1712, and 2016. Write a program that takes in a year and determines whether that year is a leap year. Ex: If the input is: 1712 the output is: 1712 - leap year
Computers and Technology
2 answers:
Tju [1.3M]3 years ago
8 0

Answer:

year = int(input("Enter a year: "))

if (year % 4) == 0:

  if (year % 100) == 0:

      if (year % 400) == 0:

          print(str(year) + " - leap year")

      else:

          print(str(year) +" - not a leap year")

  else:

      print(str(year) + " - leap year")

else:

  print(str(year) + "- not a leap year")

Explanation:

*The code is in Python.

Ask the user to enter a year

Check if the <u>year mod 4</u> is 0 or not. If it is not 0, then the year is not a leap year. If it is 0 and if the <u>year mod 100</u> is not 0, then the year is a leap year. If the <u>year mod 100</u> is 0, also check if the <u>year mod 400</u> is 0 or not. If it is 0, then the year is a leap year. Otherwise, the year is not a leap year.

castortr0y [4]3 years ago
6 0

Answer:

i_year=int(input(""))

#check leap year

if((i_year % 4 == 0 and i_year % 100 != 0) or (i_year % 400 == 0)):

  print("{} is a leap year.".format(i_year))

else:

  print("{} is not a leap year.".format(i_year))

Explanation:

You might be interested in
A ________ -tier design includes a middle layer between the client and server that processes the client requests and translates
Vanyuwa [196]

Answer:

Three.

Explanation:

5 0
3 years ago
If you often purchase items at the same e-tailer and do not have to type in your username and/or password, this probably means
tatyana61 [14]

Answer:

Explanation:

This probably means that your browser has saved your username and password into the browser's password manager. This usually occurs the first time you enter your username and password into a new website. The browser will detect this and request to save this information into the password manager. If you agree to do so it will save it and automatically enter this information when opening the site in the future.

3 0
3 years ago
What directs the read/write arm of the hard drive to where data exists and accesses it upon the user's request?
Nastasia [14]

Answer:

NTFS (New Technology File System) or FAT(File Allocation Table) are used to direct read/write arm of hard drive to where data exists and access it upon user's request

Explanation:

Both NTFS and FAT are used but NTFS is fast and optimal and superseed the FAT and supported by windows NT 3.1 and later versions.  

7 0
3 years ago
Which trait depicts honesty?
Aliun [14]

(B) reporting additional cash found in the cash register

5 0
3 years ago
Describe how you believe technology will impact our society in 50 years.
N76 [4]

Answer:

Wall-e

Explanation:

We will all be fat, lazy, on floating chairs with everything in our lives being automated thanks to AI and everyone's obsession to do less.

5 0
2 years ago
Other questions:
  • There are several vehicles in a parking lot. Some of them are motorcycles
    8·2 answers
  • Compare and contrast the following network types: Personal Area Network (PAN) Local Area Network (LAN) Metropolitan Area Network
    14·1 answer
  • When Hallmark designs its website so that a teenage girl can send a theme card to her boyfriend's cell phone, what is the primar
    6·1 answer
  • How do you calculate typing speed
    8·1 answer
  • Are you concerned that strangers may have access to the personal information you share on social media platforms? Why or why not
    10·1 answer
  • Why are answers not appearing? I've seen many complain about this recently.
    8·1 answer
  • Please choose the correct citation for the case which established the "minimum contacts" test for a court’s jurisdiction in a ca
    10·1 answer
  • HELP!!!
    15·2 answers
  • You cannot then move and resize the control on the form as desired with your mouse TRUE OR FALSE​
    6·2 answers
  • Which code snippet is the correct way to rewrite this in Semantic HTML?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!