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
Bogdan [553]
3 years ago
5

A year in the modern Gregorian Calendar consists of 365 days. In reality, the earth takes longer to rotate around the sun. To ac

count 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.
Computers and Technology
2 answers:
katrin [286]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:

GREYUIT [131]3 years ago
4 0

Answer:

import java.util.Scanner;

public class LabProgram {

  public static void main(String[] args) {

      Scanner scnr = new Scanner(System.in);

      int inputYear;

      boolean isLeapYear;

      isLeapYear = false;

      inputYear = scnr.nextInt();

      // If a year is divisible by 400,  then it is a leap year

      if (inputYear % 400 == 0)

          isLeapYear = true;

      // If a year is divisible by 100,  then it is not a leap year

      if (inputYear % 100 == 0)

          isLeapYear = false;

      // If a year is divisible by 4,  then it is a leap year

      if (inputYear % 4 == 0)

          isLeapYear = true;

      if(isLeapYear)

          System.out.println(inputYear + " is a leap year.");

      else

          System.out.println(inputYear + " is not a leap year.");

  }

}

Explanation:

  • Take the year as an input from user and store it to inputYear variable.
  • If the year is a century year, check if the year is divisible by 400 ( the year must be evenly divisible by 400 ),  then set the boolean isLeapYear to true. If a year is divisible by 100,  then set the boolean isLeapYear to false. If a year is divisible by 4,  then set the boolean isLeapYear to true.
  • Check if isLeapYear is true, then print that it is a leap year. Otherwise, print that it is not a leap year.

Output:

1712

1712 is a leap year.

You might be interested in
Plz answer all the questions :)
AURORKA [14]

Answer:

is there multiple choice or do i have to answer from my own words??

7 0
3 years ago
What does rumor Mean Cause I don't know what it means
aksik [14]
Its like a fake message that people believe. for example say that jimmy went to a party. people might start making up things about what happened with him to make gossip. Rumors are not always true, and they are fake a lot of the time. 
8 0
3 years ago
Read 2 more answers
Gn to be printed at a commercial printer. Which main ink type's exact color appearance is determined by the printer and requires
satela [25.4K]
Idek frl tho maybe go with your gut
5 0
3 years ago
Write three uses and applications of computer, people that use it,and use of computer in those areas.​
Kruka [31]

Answer:

Medical Field.

Entertainment.

Industry.

Education.

Government.

Banking.

Business.

6 0
3 years ago
In the human digestive system, which mechanism is responsible for cutting and grinding food?
makkiz [27]

Answer:

teeth

Explanation:

3 0
3 years ago
Read 2 more answers
Other questions:
  • Andrea wants to to install a new internet connection . she eants to use the fastest one she can find . what are the maximum spee
    14·1 answer
  • Analysts use _____ to show the objects that participate in a use case and the messages that pass between the objects over time f
    12·1 answer
  • "A ____ is a collection of hardware and other devices that are connected together so that users can share hardware, software, an
    5·1 answer
  • Write a program in C++ or C that includes two different enumeration types and has a significant number of operations using the e
    15·1 answer
  • The dns server translates the URL into the IP address 8.8.8.8. What is the next step in the process?
    11·1 answer
  • Write at leaat 20 shortcuts on the Microsoft word.​
    12·1 answer
  • What are the 5 font/typography families
    14·1 answer
  • _______are a set of track sectors, ranging from 2 to 32 or more, depending on the formatting scheme in use.
    11·1 answer
  • in a stop-and-wait arq system, the bandwidth of the line is 1 mbps, and 1 bit takes 10 ms to make a round trip. if the system da
    12·1 answer
  • Real estate management software
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!