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
Y_Kistochka [10]
3 years ago
11

2.13 LAB: Branches: Leap Year

Computers and Technology
1 answer:
Neporo4naja [7]3 years ago
5 0

Answer:

The program in Python is as follows:

year = int(input("Enter a year: "))

print(year,end=" ")

if year % 4 == 0:

  if year % 100 == 0:

      if year % 400 == 0:           print("is a leap year")

      else:           print("is not a leap year")

  else:       print("is a leap year")

else:   print("is not a leap year")

Explanation:

This gets input for year

year = int(input("Enter a year: "))

This prints year, followed by a blank

print(year,end=" ")

If year is divisible by 4

if year % 4 == 0:

If yes, check if year is divisible by 100

  if year % 100 == 0:

If yes, check if year is divisible by 400; print leap year if true

      if year % 400 == 0:           print("is a leap year")

print not leap year if year is not divisible by 400

      else:           print("is not a leap year")

print leap year if year is not divisible by 100

  else:       print("is a leap year")

print leap year if year is not divisible by 4

else:   print("is not a leap year")

You might be interested in
ANYBODY WANNA PLAY FoRnITe
ValentinkaMS [17]

Answer:

No but my baby brother can play with u

6 0
3 years ago
Read 2 more answers
Unlike a virtual image, a real image
IRINA_888 [86]
C.cannot be viewed on a screen
4 0
3 years ago
Rank these three account types in order of decreasing liquidity. Start by picking the most liquid account type first
Ghella [55]
As there are no options given, I will simply mention the three most liquid accounts in order:

<span>1. Checking Account
2. Savings Account
3. Money Market Deposit Account

Account liquidity refers to the ease and comfort with which you can take your money out of an account from a bank, there are various bank accounts which can be referred to as liquid assets.</span>
5 0
3 years ago
Read 2 more answers
Program to calculate series 10+9+8+...+n" in java with output
avanturin [10]

Answer:

import java.util.Scanner;

class Main {

 public static int calcSeries(int n) {

   int sum = 0;

   for(int i=10; i>=n; i--) {

     sum += i;

   }

   return sum;

 }

 public static void main(String[] args) {

   Scanner reader = new Scanner(System.in);

   int n = 0;

   do {

     System.out.print("Enter n: ");

     n = reader.nextInt();

     if (n >= 10) {

       System.out.println("Please enter a value lower than 10.");

     }

   } while (n >= 10);

   reader.close();

   System.out.printf("sum: %d\n", calcSeries(n));

 }

}

5 0
3 years ago
How do I write this code in java? input "Enter Your Age to Order a Beer"
Klio2033 [76]

Answer:

i dont know sorry but answer above lol

Explanation:

5 0
2 years ago
Other questions:
  • A function operates on this, which may consist of a constant, a cell reference, or another function.
    7·1 answer
  • What is data security
    14·1 answer
  • Is ubisoft still making assassins creeds on xbox 360
    8·2 answers
  • A web ______ is a computer that delivers requested webpages to your computer or mobile device.
    7·1 answer
  • If a website ends with .gov does it mean that its written by the government or?
    11·2 answers
  • HIPAA requires the following controls for medical records: A. Encryption of all data B. Technical safeguards C. Physical control
    12·1 answer
  • What does CS mean? idk
    14·2 answers
  • You send a friend a private message about something personal that is going on with you. Without permission, she forwards your te
    10·1 answer
  • Calculate how many different pixel colours could be formed if one of the bytes gives the intensity of the red colour, one of the
    15·1 answer
  • What does Amara hope will<br> happen when Dad sits on the sofa?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!