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
Egovernment involves the use of strategies and technologies to transform government by improving the delivery of services and en
aleksandrvk [35]
I guess the answer True
3 0
3 years ago
Special computers, called __________, keep databases of IP addresses and their corresponding names
vitfil [10]
Name servers.
-----------------------------------------------------------
4 0
3 years ago
The difference between the centerline of a vehicle and the line perpendicular to the rear wheels is called what?
snow_lady [41]
The thrust angle is an imaginary line drawn perpendicular to the rear axle's centerline. It compares the direction that the rear axle is aimed with the centerline of the vehicle. It also confirms if the rear axle is parallel to its front axle and that the wheelbase on both sides of the vehicle is the same.
7 0
3 years ago
Overloading in methods are popular in programming, and why overloading is important.
Cerrena [4.2K]

Answer:

 Yes, overloading is one of the methods which are popular in programming language. Overloading basically refers to the same function but different signature called function overloading or method overloading. It is the ability to define the multiples method by using the single identifier.

The overloading is important because it has the ability to design the multiple method by using similar name. It also provide the high flexibility to the programmers to call the same method in the data. overloading basically provide the high clarity in the code.

Overloading is used to achieved the compile time polymorphism.  

Following are program of function overloading in c++ are:

Class abc // creating class

{

public:

int p;

void fun() // function fun with no parameter/

{

cout<<” hello “;

}

void fun(int a) // function fun with parameter

{

p=a;

cout<<p;

}

};

int main() // main function

{

abc ob; // creating object

ob.fun();// print hello;

ob.fun(6);// print 6

return 0;

}

Explanation:

In this program the function fun() have same name but different signature in the main method we create the object of class abc i.e ob. ob.fun() this statement called the function with no parameter and ob.fun(6) this statement will called the function with integer parameter.

5 0
3 years ago
A major retailer wants to enhance their customer experience and reduce losses
Mrac [35]

Answer:

Predict Demand

Explanation:

The type of Artificial Intelligence (Al) solution that would be suitable for solving this problem is "Predict Deman"

By predicting the demand of the potential consumer through the Artificial intelligence solution the retailer would be able to eliminate leftover out-of-stock scenarios because the adequate quantity of the products or demands will be provided thereby enhancing customers' experience arising from out-of-stock scenarios and reducing losses arising from the leftover.

5 0
3 years ago
Other questions:
  • Look at the following Python code:
    11·1 answer
  • What is output by the following?<br><br>print (type("95"))
    13·1 answer
  • What shortcut keys do i use to print something on my keyboard ?
    6·2 answers
  • Why did Hunter gatherers moved into the<br>America's?​
    8·1 answer
  • Which do web servers host?<br> Websites<br> Networks<br> Firewalls<br> Zones
    8·1 answer
  • An inventory management system that goes beyond just managing inventory to act as a complete distribution system (including inve
    10·1 answer
  • . When a function template has two parameterized types, one as the return value, and one as an argument, then _____.
    11·1 answer
  • Write a class Bug that models a bug moving along a horizontal line. The bug moves either to the right or left. Initially, the bu
    7·1 answer
  • In Python, which comparison operator means "less than or equal to"?
    5·2 answers
  • What is 11x12x12x14x15x16
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!