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 top level class may have only the following accessmodifier.
GREYUIT [131]

Answer: Public

Explanation:

 A top level class can have a public, as top level cannot be private and protected because the modifier private is not allowed. As, top level is a class which is not a nested class. Interface of a access modifier is either public or no modifier. There are two types of access control modifier are top level - public and member level- private, protected.

3 0
3 years ago
Which command displays the status of the ipsec installation?
Alexandra [31]
Character command shows the status.
8 0
3 years ago
What is the difference between spyware and adware?
Sati [7]

Answer:

It's C

Explanation:

Adware displays or directs the users to an advertisement, while spyware performs espionage on the computer`s activity.

8 0
2 years ago
Read 2 more answers
Is microsoft word the same as microsoft office?
ycow [4]
Hey there!

Microsoft Word is considered a part of Microsoft Office. Office is a package of Microsoft applications that can be used on Windows or MacOS that includes Word, PowerPoint, Excel, Outlook, and many other programs used for either personal or commercial use. Microsoft Word is just one of those programs, so, no, they're not the same thing. 

Hope this helped you out! :-)
3 0
3 years ago
Read 2 more answers
Which of the following is not a use of a hash function
soldi70 [24.7K]

Answer:

the answer would be there

Explanation:

7 0
3 years ago
Other questions:
  • Can a computer evaluate an expression to something between true and false? Can you write an expression to deal with a "maybe" an
    13·2 answers
  • Encryption is the process of:
    12·1 answer
  • The number of credits awarded for the CLEP exam is determined by__<br> Help pls!
    15·1 answer
  • The _______ has shortcuts to commonly used commands
    8·2 answers
  • Write a program that responds to a positive integer passed on the command line with the number of bits needed to express that nu
    10·1 answer
  • The ____ method returns an integer that represents the location of the substring within the string.
    13·1 answer
  • If you can name this you get 15 points: ↑↑↓↓←→←→βα
    10·1 answer
  • You are testing the user experience.
    12·2 answers
  • The system where the unit of measurement is centimeter
    15·1 answer
  • Int value[10] = {1, -7, 95, 123, 80, 67, -30, 17, 152, 121} ;
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!