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
Say you write a program that makes use of the Random class, but you fail to include an import statement for java.util.Random (or
Levart [38]

Explanation:

you can find that question in social media

6 0
3 years ago
When Tim Berners-Lee developed the first specifications, protocols, and tools for the World Wide Web in 1993, his employers at C
Svetllana [295]

Answer:

c.

Explanation:

People trust open-source software - if they can see how it works and understand it, they can help improve it and build applications using it. If these protocols were not publicly available - then nobody would have implemented services using them - so nobody would be adopting it.

8 0
4 years ago
Write code using the range function to add up the series 20, 30, 40, ... 90 and print the resulting sum each step along the way.
andrew11 [14]

Answer:I DK but if you expaln it I can help. Sorry.

Explanation:

3 0
3 years ago
Which of the following would determine how many elements are in values?
DiKsa [7]
I guess depends on the language but for both java and C++ answer 3 is correct.
3 0
3 years ago
Roy is preparing for his test in English. He creates lots of memory tools and studies using a circuit-learning schedule that he
kozerog [31]
He should get an good night sleep the day before the test, eat a filling breakfast, get to school on time, sit in his and relax. to take a test as much as you prepare for it you mustalso be calm; being frazzled will make it hard to concentrate. some streaches will release any stress and boost confidence. also letting some blood get to your brain will help you think better. to pass a test you must study, stable, relaxed, and alert.
8 0
3 years ago
Other questions:
  • For local travel addresses and street names should be
    14·1 answer
  • What does the cpu do (in terms of register contents and stack) when it executes a jsr instruction?
    12·1 answer
  • Sabiendo que el engranaje motriz tiene 14 dientes y gira a 4000 RPM, y el conducido tiene 56 dientes, responde:
    11·1 answer
  • Why is personal responsibility important when considering technology?​
    14·2 answers
  • Susan is in charge of the inventory reports for her company.She will need to find specific inventory items as well as project in
    9·1 answer
  • Assume that month is an int variable whose value is 1 or 2 or 3 or 5 ... or 11 or 12. Write an expression whose value is "jan" o
    10·1 answer
  • In MMF2, what does the * symbol mean?
    5·1 answer
  • Draw the tree that results when you add the values 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 to each of the following initially em
    15·1 answer
  • Mohammed’s parents learn that his classmates have begun sending him text messages making fun of his heritage. Mohammed says he’s
    5·2 answers
  • How to create create a database in mysql using clv files
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!