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
When creating an electronic slide presentation, Lee should avoid
Amanda [17]

I believe the answer is <u>Using sound effects between slides.</u>

Using sound effects between slides can cause for a distraction, and if you are in college, your professor may not score your presentation as well as if it were made without sound effects. Hope this helps!

5 0
2 years ago
Alison discovers that a system under her control has been infected with malware, which is using a key logger to report user keys
Bond [772]

Mostly the spyware and malware protection for desktop and laptop or workstations are to protected with anti-virus regular updates. All workstation or desktop or laptops are to updated operating systems patches.

If any operating systems patched update to be schedule and checked regularly. Schedule scanning by virus scanner to be made for desktop and laptop or workstations in regular interval basis

There are third parties tools such as malware and ADWCLEANER are also available free scanner software through internet where end user can download and scanner so software will clean the malware.

Mostly end user do mistake keep the files in desktop. Most of the malware software will affect the desktop folder only.

It will also affect c:\users folder and register enter keys.

7 0
3 years ago
The amount of memory used by an array depends upon the array's data type and the number of elements in the array. True False
OverLord2011 [107]

Answer:

True

Explanation:

6 0
2 years ago
What happens when a user updates a record after a developer creates a Workflow Rule declaratively that updates a field on an obj
Sindrei [870]

Answer:

d. The trigger is fired more than once.

Explanation:

What would happen in this situation is that the  trigger would be fired more than once. This is because the trigger will be fired when the user updates the record. It will also be fired when the process builder is run.

If the trigger fires more than once, this can be problematic for the developer. Therefore, it is better if the trigger fires just once, as this is the time when the present changes can be placed.

5 0
3 years ago
Heather is troubleshooting a computer at her worksite. She has interviewed the computer’s user and is currently trying to reprod
Aleksandr [31]

Answer:

D. Identify the problem.

Explanation:

There are six steps or stages in computer system troubleshooting. They are,

1. Identify the problem: In the stage of troubleshooting, the user is interviewed to get a description of the problem. Reproducing the problem is essential to confirm the described problem of the system before moving to the next stage.

2. Establish a theory of probable cause: when the problem is identified, a list of the possible cause of the problem is made.

3. Test the theory to determine a cause: each items on the list of possible cause of the problem is tested to confirm its actual cause.

4. Resolve the problem.

5. Verify full system functionality

6. Document the findings, actions and outcomes.

8 0
3 years ago
Other questions:
  • Why do computers need to periodically check the dns for websites you have already visited? enter your answer here?
    15·1 answer
  • What is Gamekit Loa3's all questsions
    14·1 answer
  • Learning about public speaking can help improve your ________________.
    15·1 answer
  • Some hardware can be added to the computer without having to restart or power down the computer. After a short period of time th
    5·1 answer
  • Patronage of most Medieval musicians was supplied by the
    13·1 answer
  • Radio waves can be used to transmit energy. What is an advantage of this method in computer technology
    7·2 answers
  • Computer network reduces the cost of operation​
    14·1 answer
  • Write a program to input elements of 4*3matrix and prints its elements properly using array ​
    7·1 answer
  • ____ storage is not recommended for long-term archiving because the storage media can degrade over time
    15·1 answer
  • Which file type is the best choice if the image will be made into a billboard?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!