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
kakasveta [241]
3 years ago
15

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 is a leap year. Ex: If the input is: 1913 the output is: 1913 is not a leap year.
Computers and Technology
2 answers:
Taya2010 [7]3 years ago
6 0

Answer:

// program in C++ to check leap year.

// include header

#include<iostream>

using namespace std;

// main function

int main() {

// variable

  int inp_year ;

  // ask user to enter year

  cout<<"Enter year:";

  // read year

  cin>>inp_year;

  // check year is leap or not

  if (((inp_year % 4 == 0) && (inp_year % 100 != 0)) || (inp_year % 400 == 0))

  // if leap year , print leap year

     cout<<inp_year<<" is a leap year.";

  else

  // print not leap year

     cout<<inp_year<<" is not a leap year.";

  return 0;

}

Explanation:

Read year from user.Then check if year is divisible by 4 and not divisible by 100 or year is divisible by 400 then year is leap year.otherwise year is not  leap year.

Output:

Enter year:1712                                                                                                            

1712 is a leap year.

Lera25 [3.4K]3 years ago
5 0

Answer:

#include <iostream>

using namespace std;

int main() {

  int inputYear;

 cin>>inputYear;

 // check year is leap or not

 if (((inputYear % 4 == 0) && (inputYear % 100 != 0)) || (inputYear % 400 == 0))

 // if leap year , print leap year

    cout<<inputYear<<" - leap year" << endl;

 else

 // print not leap year

    cout<<inputYear<<" - not a leap year" << endl;

 

  /* Type your code here. */

  return 0;

}

Explanation:

You might be interested in
Is the cell phone changing our views about polite and impolite behavior? For example,
Otrada [13]

a cell phone is changing our views in both polite and unpolite ways because these days I see people at dinner tables on their phones taxting and not actually socializing with the people around them but at the same time people who like other people posts on instagram and wright good comments are being very polite to the person who posts it.

4 0
3 years ago
Read 2 more answers
Which of the following can a cell contain?
Ksju [112]
The answer is choice D-All of these :)
8 0
3 years ago
Read 2 more answers
Consider the university enrollment database schema: 547 Student(snurn: integer, snarne: string, majoT: string, level: string, ag
trapecia [35]

Enroll a student identified by her snum into the class named 'Introduction to Database Systems' is the following transactions, state the SQL isolation level you would use.

1. Enroll a student identified by her snum into the class named 'Introduction to Database Systems'.

<u>Explanation:</u>

Since enroll is unique in the university enrollment database schema and field name is SNUM and it is data type is an integer. To identify student class name and department name and name of student SNUM field is used for searching in university enrollment database schema. Enrollment changing is not possible of the student’s not possible or not good practices in university enrollment database schema.

If a query had been made class wise or department wise enrollment is played an important role.

For  assign, a faculty is made on the class id or  department id.

8 0
3 years ago
Laura is confused with the spelling of the word pronunciation. She types the word as pronounciation throughout a document. Which
Ivan

Not really is she wants the words that she's typing down sometimes it's not necessary to leave it to the auto correct It can always be bad when re-reading it again.

5 0
2 years ago
You are finally at the stage of the software life cycle where you begin programming. What is this stage called?
nataly862011 [7]
You are finally at the stage of the software life cycle where you begin programming. What is this stage called?

development

5 0
2 years ago
Other questions:
  • How can investors receive compounding returns? A: by selecting a savings account that has a higher interest rate B: by investing
    9·2 answers
  • Explain the role of the domain name system
    15·1 answer
  • Which technology forms the foundation for cloud computing? forms the foundation for cloud computing.
    12·2 answers
  • What component of Kerberos is responsible for storing keys for encrypting and decrypting data in the authentication process?
    13·1 answer
  • How do emotions affect purchasing decisions?
    6·1 answer
  • A sequence of one or more characters is called
    14·1 answer
  • How do u use this app?
    15·2 answers
  • Which camera mode gives the photographer the greatest amount of control?
    7·2 answers
  • The head of small organization wants to install a network so that all the employees of different department can share various re
    14·1 answer
  • When do you use an else statement?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!