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
Suppose you want to view a document that has several headings. what view would you use?
bija089 [108]
Um i think outline. :)
5 0
2 years ago
Need help with this
andrezito [222]

Answer:

13:a. 15:c. 14:Unknown answer

6 0
2 years ago
Which software documentation guideline did the IEEE establish?
Tomtit [17]

Answer:

B

Explanation:

I am big brain

8 0
2 years ago
Write a program that asks the user for the speed of a vehicle (in miles per hour) and how many hours it has traveled. It should
HACTEHA [7]

Answer:

speed = float(input("Enter the speed: "))

hours = int(input("Enter the hours: "))

distance = 0

for i in range(hours):

   distance += speed * 1

   print("The distance after " + str(i+1) + ". hour(s): " + str(distance))

Explanation:

*The code is in Python.

Ask the user to enter the speed and the hours

Initialize the distance as 0

Create a for loop that iterates hours times. Inside the loop, calculate the cumulative distance traveled at the end of each hour and print it (Note that the distance = speed x hour)

5 0
3 years ago
What programming language supports relational databases?
WINSTONCH [101]

A programming language that supports relational databases is SQL (Structured Query Language)

Structured Query Language (SQL), is the principal method for communicating with Relational Databases.

A relational database is a group of data elements that are linked together by predefined connections. These elements are laid up in the form of a series of tables containing columns and rows.

  • Tables are utilized for storing data about the items that will be displayed in the database.
  • A column in a database contains a specific type of data, whereas a field records the actual value of an attribute.
  • The table's rows indicate a collection of linked values for a single item or entity.

Each entry in a database can be assigned a unique identity known as a primary key, and rows from other tables can be linked together via foreign keys. This data may be accessible in a variety of ways without having to reorganize the database tables itself.

Learn more about Relational Databases here:

brainly.com/question/8457395?referrer=searchResults

5 0
2 years ago
Other questions:
  • The ________ method displays a message to the user and contains one button.
    6·1 answer
  • If you wanted to buy a house that cost $150,000 and you knew you needed a down payment of five percent, how much would you need
    8·1 answer
  • It is possible to change the shape of a text box.
    10·1 answer
  • Which of the following browsers was introduced with windows 10?
    10·1 answer
  • Which item is used for formatting in responsive web design?
    14·2 answers
  • Why would a programmer use a flow chart? (Edge2020 Coding Critical Thinking Questions)
    9·1 answer
  • When you purchase donuts, they come in boxes of 12, so 24 donuts take 2 boxes. All donuts need to be in a box, so if you buy 13
    10·1 answer
  • which program monitors the computer by looking for known trouble makers as well as suspicious behavior​
    11·1 answer
  • Which one is exit controllefd loop ?<br>1.while loop <br>2. for loop<br>3. do loop<br>4. none <br>​
    11·1 answer
  • In QBasic, create a number guessing challenge. Your program should generate a random number from 1-
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!