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
This is on zyBooks. Please write the code in C++, please!
poizon [28]

The program is an illustration of built-in functions

<h3>What are built-in functions?</h3>

They are named program statements that have a predefined purpose

<h3>The actual program</h3>

The program written in C++, where comments are used where required is as follows:

#include <iostream>

#include <cmath>

#include <ios>

#include <iomanip>

using namespace std;

int main (){

double x;

double y;

double z;

cin>>x;

cin>>y;

//This calculates the given expression

z = pow(sqrt(y),x);

cout << fixed<<setprecision(2);

cout<<z<<endl;

return 0;

}

Read more about python functions at:

brainly.com/question/14284563

7 0
2 years ago
Create a statement trigger called "bt_maj_adv_trigger" that would be work with both advisor as well as major table. If a record
denis23 [38]

Answer:

Create or replace trigger at_advisor

after delete or insert or update on advisor

for each row

Begin

  if inserting

then

  insert into

     log_maj_adv

  values

     (

        user, :new.adv_code, sysdate, 'insert'

     )

;

elsif deleting

then

  insert into

     log_maj_adv

  values

     (

        user, :new.adv_code, sysdate, 'delete'

     )

;

else

  insert into

     log_maj_adv

  values

     (

        user, :new.adv_code, sysdate, 'update'

     )

;

end if;

End;

Explanation:

as per above answer.

5 0
3 years ago
Read 2 more answers
Briefly explain how an operating system may be described as an "interrupt-driven program." as system calls) from
Reptile [31]

Answer: Interrupt-driven program is defined as the program that permits to executes by stopping the execution of the currently running program.The completion of the program is indicated by the interrupt as a signal from assistant action .

Operating system is the system that carries out the functions and task of computer system.It has the major mechanism in which every alteration and changes are remarked such as state of hardware, event alteration, software component changes etc by the interrupt system.

Through interrupt system the operating system conducts new assignment and task for the compensation of changes that occurred in the system by halting the current working. Resources are invoked to fulfill the requirement of the work load.Thus, operating system can act in interrupt driven system's  manner.

7 0
3 years ago
Which of the following tasks requires you to use the Tabs option?
LenaWriter [7]
In Microsoft Word, the TAB button shifts the text to the right. For example, starting a new paragraph, the TAB button indents the beginning.<span />
3 0
2 years ago
You have created a personal web page using a commercially available design program and web hosting site. The only items on your
maria [59]

Answer:

Notepad or Sublime text

Explanation:

These softwares enables you use and edit the website HTML, CSS and JavaScript code where necessary. Thank you.

4 0
2 years ago
Other questions:
  • The second stage of digestion takes place in the small intestine. <br> True Or False?
    8·1 answer
  • A ____ is a data network connection that makes use of the public telecommunications infrastructure but maintains privacy through
    13·1 answer
  • Want is the assignmment
    8·1 answer
  • What process combines data from a list with the content of a document to provide personalized documents?
    11·2 answers
  • Your browsing the Internet and realize your browser is not responding which of the following will allow you to immediately exit
    14·2 answers
  • A) How can jitter be reduced on a user’s PC if there is jitter in incoming packets?
    10·1 answer
  • Can someone write a 5 sentence summary about Virtual Assistants. Please. I'm in a rush. Personal problems.
    5·1 answer
  • Which feature allows you to copy attributes of
    11·1 answer
  • Case Study/Scenario: First, Julio clicks Tools from the Chrome menu on the toolbar. Next, he looks for Manage Add-Ons but can no
    9·1 answer
  • 2. The On and Off states are represented by _____________ class 7 number system​
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!