answer.
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]
1 year 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]1 year 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]1 year 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
Mark and John are developing a program using Python. They name a variable 24_hour_mart, but then recognize that this name violat
77julia77 [94]

Answer:

Option 2: Variable names can not begin with a number.

Explanation:

As given Mark and John named a variable as 24_hour_mart while writing a program in python.

While it is forbidden to name a variable starting with any digit, only alphabets (capital and smaller) and underscore can be the first letter of the variable name.

Moreover, by considering the other options given:

  • Variable name can include the underscore (_) between the words. It is used instead of spaces that are not allowed.
  • There is no upper limit for variable length, it can be of any reasonable length and more than 10 characters say 11 or 12 are reasonable.
  • There is no lower limit for variable length, it can be any reasonable length , even it can be of 1 character.

Variables named in python language must not be the keywords as they are reserved for other purposes.

i hope it will help you!

3 0
2 years ago
Consider the following scenario: "You are an assistant to the accounting manager for a small company that sells sports equipment
Rzqust [24]

Answer:

1. Microsoft Excel helps data analysis through different spreadsheet queries and operations options.

2. Input data to the analysis of sales by product is required for the development of formula and extracting results.

3. The information of data source and frequency of report is required to start the work.

Explanation:

1. Microsoft Excel tool can be used to calculate the results of equipment. Obtained results can be displayed in charts and graphs from the excel.

2. Information like the quantity of sold items, remaining items are required to produce accurate, useful analysis.

Before starting assignment accounting manager will be asked the following questions.

1) Where does the input data come from?

2) Is analysis required on a daily basis or once for all provided data?

3) Is Summary is in the form of tabular data, Graphical data, or Both?

4 0
2 years ago
Interactive sites where users write about personal topics and comment to a threaded discussion are called 
Sedaia [141]

The answer to your question is A. blogs

3 0
2 years ago
Write a function max_magnitude() with two integer input parameters that returns the largest magnitude value. Use the function in
JulsSmile [24]

Answer:

def max_magnitude(user_val1, user_val2):

if abs(user_val1) > abs(user_val2):

return user_val1

else:

return user_val2

if __name__ == '__main__':

n1 = int(input("Enter the first integer number: "))

n2 = int(input("Enter the second integer number: "))

print("The largest magnitude value of", n1, "and", n2, "is", max_magnitude(n1, n2))

Explanation:

5 0
1 year ago
A cast is required in which of the following situations? a. using charAt to take an element of a String and store it in a char b
notka56 [123]

Answer:

Option(d) i.e "storing a float in an int" is the correct answer for the given question.

Explanation:

  • Typecast is used for the changing the one datatype to the another datatype Their are two types of casting  

1 implicit

In this typecast we change the smaller datatype into the larger datatype.

For example

int to float  

2 Explicit  

In this typecast we change the larger datatype into the smaller datatype in an explicit manner.

For example

float to int.

  • in the given question we required the casting in the option(d) i.e "storing float in an int" That's why this option is correct and all other options are incorrect.
3 0
2 years ago
Other questions:
  • In a situation where handicapped person can only input data into the computer using a stylus or light pen, which keyboard config
    7·2 answers
  • Which type of address is used at the transport layer to identify the receiving application?
    14·1 answer
  • Carrie works on a help desk and is assigned a ticket that was automatically generated by a server because of an error. The error
    5·1 answer
  • Which advertising medium has the widest reach on a global front?
    12·1 answer
  • Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integer
    12·2 answers
  • Ld' is the instruction with the longest latency on the CPU from Section 4.4 (in RISC-V text). If we modified ld and sd so that t
    15·1 answer
  • Show the stack with all activation record instances, including static and dynamic chains, when execution reaches position 1 in t
    10·1 answer
  • Return 1 if ptr points to an element within the specified intArray, 0 otherwise.
    7·1 answer
  • Finish the program to compute how many gallons of paint are needed to cover the given square feet of walls. Assume 1 gallon can
    9·1 answer
  • Which business case is better solved by Artificial Intelligence (AI) than conventional programming
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!