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
Goryan [66]
3 years ago
11

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.

Ex: If the input is 1712, the output is:

1712 is a leap year.
Ex: If the input is 1913, the output is:

1913 is not a leap year.
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();

/* Type your code here. */
}
}
Computers and Technology
2 answers:
Bas_tet [7]3 years ago
8 0

Answer:

def is_leap_year(year):

  if(year % 400 == 0):

      return True

  elif year % 100 == 0:

      return False

  elif year%4 == 0:

      return True

  else:

      return False  

if __name__ == '__main__':

  n = int(input())

  if(is_leap_year(n)):

      print(n,"is a leap year.")

  else:

      print(n, "- not a leap year")

Explanation:

denpristay [2]3 years ago
5 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:

If a year is 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
Janeal spends her day looking at the stock and bond markets and evaluating how the portfolios of the businesses she serves will
pychu [463]

Answer:

ur answer good sir will be : financial analyst

and a brainliest will be good to thnx

4 0
3 years ago
1. Which markup language adds the ability to use video without requiring the user to download add-ons?
aniked [119]

HTML5

HTML5 has fewer plug-ins like the ability to standardize how audio and video are presented on a Web page. It introduces the <video> element designed to remove the need to install 3rd party add-ons and plug-ins like adobe flash player. It also adds the <audio> element  too that allows pages to smoothly add audio files.

3 0
2 years ago
What can you say about the different website that you used? do they have in common?​
Harrizon [31]
They all have ads. Some have inappropriate ads while some have irrelevant ads with respect to the website your on.
8 0
2 years ago
A relational database is different from a simple database because it has more than one _____. record ID number table field
Ulleksa [173]

Answer:Table

Explanation:A relational database has structures and thus have more than one table. The tables consist of row (for entry) and column (for data). As a result, data are organized in a simple manner and are normally consistent.

6 0
3 years ago
You just realized the turn signal on your vehicle is broken,
zimovet [89]

Answer:

c

Explanation:

7 0
3 years ago
Other questions:
  • Brittany just pulled up a database table with employee information that contains 50 records of employees at her company. Which o
    12·1 answer
  • The major difference between a calculator and a computer, when performing calculations, is that a
    10·1 answer
  • Analyze the following code. // Program 1: public class Test { public static void main(String[] args) { Object a1 = new A(); Obje
    5·1 answer
  • Identify tags and attributes in HTML 5
    5·1 answer
  • Whats the correct answer
    15·2 answers
  • Write any four difference between email and effects​
    14·1 answer
  • Steve left his computer switched on in his room and went out to have breakfast. When he returned, he saw that the monitor had be
    9·1 answer
  • Which of the following is NOT true about a flow chart?
    8·1 answer
  • There are some games that cannot be described by a single--or even two-- genres. Can you think of any that should be invented?​
    6·1 answer
  • How are digital and analog data similar? How are they different?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!