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
BARSIC [14]
3 years ago
6

3.26 LAB: Leap Year A year in the modern Gregorian Calendar consists of 365 days. In reality, the earth takes longer to rotate a

round the sun. To account 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 - leap year
Computers and Technology
2 answers:
Tju [1.3M]3 years ago
8 0

Answer:

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

if (year % 4) == 0:

  if (year % 100) == 0:

      if (year % 400) == 0:

          print(str(year) + " - leap year")

      else:

          print(str(year) +" - not a leap year")

  else:

      print(str(year) + " - leap year")

else:

  print(str(year) + "- not a leap year")

Explanation:

*The code is in Python.

Ask the user to enter a year

Check if the <u>year mod 4</u> is 0 or not. If it is not 0, then the year is not a leap year. If it is 0 and if the <u>year mod 100</u> is not 0, then the year is a leap year. If the <u>year mod 100</u> is 0, also check if the <u>year mod 400</u> is 0 or not. If it is 0, then the year is a leap year. Otherwise, the year is not a leap year.

castortr0y [4]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:

You might be interested in
. Reorder the following efficiencies from smallest to largest:
alexdok [17]

Answer:

The order of the efficiencies is as following:-

10,000 < 2n < nlog(n) < n5 < n!.

Explanation:

10,000 is constant time whatever will be the size of the problem the efficiency will remain the same.

2n this efficiency is linear it will grow proportionally as the size of the problem increases.

nlog(n) this efficiency is is a bit greater than 2n though it will grow faster than 2n but slower than n2 as the size of the problem increases.

n5 this efficiency is very poor.It is growing very rapidly as the size of the problem increases.

n! is the worst efficiency of them all.

n!=n*(n-1)*(n-2)*(n-3)*(n-4)*.......2*1.

It will grow beanstalk in jack and the beanstalk.

3 0
3 years ago
Differentiate between inherited trait and acquired trait​
miskamm [114]

Answer: Inherited trait is something you already have and acquired is something that you learn or achieve.

Explanation:

8 0
3 years ago
Suppose a program contains 500 million instructions to execute on a processor running on 2.2 GHz. Half of the instructions takes
Anit [1.1K]

Answer:

1.48 s

Explanation:

Number of instructions = 500 million = 500 * 10⁶

clock rate = 1 / 2.2 GHz = 1 / (2.2 * 10⁹ Hz) = 0.4545 * 10⁻⁹ s

We need to compute the clocks per instruction (CPI)

The CPI = summation of (value * frequency)

CPI = (50% * 3 clock cycles) + (50% * 10 clock cycles)

CPI = (0.5 * 3) + (0.5 * 10) = 1.5 + 5 = 6.5

Execution time = number of instructions * CPI * clock rate

Execution time = 500 * 10⁶ * 6.5 * 0.4545 * 10⁻⁹ =1.48 s

5 0
3 years ago
The parts of a memo are _____.
RoseWind [281]

They would be:

Reader’s name, your name, the date, the subject, and the body of the memo.

4 0
3 years ago
Read 2 more answers
Describe email etiquette and netiquette when communicating electronically.
navik [9.2K]

Answer:

Email etiquette refers to the principles of behavior that one should use when writing or answering email messages. It is also known as the code of conduct for email communication. Email etiquette depends upon to whom we are writing- Friends & Relatives, Partners, Customers, Superior or Subordinates

Difference Between Etiquette and Netiquette is that Etiquette is the simple requirements needs for social behavior while Netiquette, is the code of acceptable behaviors users should follow while on the Internet.

6 0
3 years ago
Other questions:
  • The Circle of Growth
    10·1 answer
  • An object is suspended in a wind tunnel and the force measured for various levels of wind velocity: v (m/s) 10 20 30 40 50 60 70
    10·1 answer
  • Write HTML code for inserting an image "cricket.jpeg" in size 500 width and 400 height.
    12·1 answer
  • Why does this app say im following a question? how do i make it stop?​
    14·2 answers
  • ou have a company network that is connected to the internet. You want all users to have internet access, but you need to protect
    13·1 answer
  • Hey i need some help with code.org practice. I was doing a code for finding the mean median and range. the code is supposed to b
    14·1 answer
  • If someone you don’t know asks where you go to school, what should you do
    12·1 answer
  • Carmina works at a fast-food restaurant. During the slow afternoon hours, Carmina always find projects to keep her busy, like wa
    6·1 answer
  • Priortization is an example of a skill that helps you reach long term goals because
    14·1 answer
  • What is added to brining liquid to add flavour​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!