Determines whether or not the year is a leap year

Assignment Help Basic Computer Science
Reference no: EM131220060

Write a program that accepts a year and determines whether or not the year is a leap year. Use the mod function. The output should be the variable extra_day, which should be 1 if the year is a leap year and 0 otherwise. The rules for determining leap years in the Gregorian calendar are:

1. All years evenly divisible by 400 are leap years.

2. Years evenly divisible by 100 but not by 400 are not leap years.

3. Years divisible by 4 but not by 100 are leap years.

4. All other years are not leap years.
For example, the years 1800, 1900, 2100, 2300, and 2500 are not leap years, but 2400 is a leap year.

Reference no: EM131220060

Questions Cloud

Computes the array b by computing the natural logarithm : Write a program that computes the array B by computing the natural logarithm of all the elements of A whose value is no less than 1, and adding 20 to all the other elements
Task involves use of the profit equation and cvp analysis : This task involves the use of the profit equation and CVP analysis. Read the scenario given below and respond to the questions that follow. Clyde’s Marina has estimated that fixed costs per month are $300,000 and variable cost per dollar of sales is ..
Obtain the uncoded ber performance of bpsk modulation : Obtain the uncoded BER performance of BPSK modulation over AWGN and Rayleigh fading channels through computer simulation - Select a suitable range of Eb/NO so that you obtain the BER in the range of (approximately) 10-1 to 10-6 .
Explain methods used to account for assets and liabilities : Discuss methods used to account for assets, liabilities, and shareholder equity, and explain how the company's inventory valuation method affects reported results.
Determines whether or not the year is a leap year : Write a program that accepts a year and determines whether or not the year is a leap year. Use the mod function. The output should be the variable extra_day, which should be 1 if the year is a leap year and 0 otherwise.
Prepare cost reconciliation report for the baking department : Maria Am Corporation uses a process costing system. The Baking Department is one of the processing departments in its strudel manufacturing facility. In June in the Baking Department, the cost of beginning work in process inventory was $3,570, the co..
Resulting values for net cash flow in each period make sense : A firm pays $100 in period 1 to produce some goods. It sells those goods for $150 in period 2 but does not collect payment from its customers until period 3. Calculate the cash flows to the firm in each period by completing the following table. Do th..
Prepare a flowchart on real-life service organisation : Choose a real-life service organisation that you are familiar with. You need to inform your lecturer of your choice - Prepare a flowchart of the back-stage as well as the front-stage operations of this business.
Briefly summarize the classical style in sculpture : Briefly summarize the "classical" style in sculpture. - What do you think is the most important aspect of the classical moment?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Total interest payment after one year

You invested $10,000 into two accounts: one that has simple 3% interest, the other with 2.5%interest. If your total interest payment after one year was $283.50, how much was in each account after the year passed?

  Why are you normally required to bind a service

What steps need to be taken by a network service to be ready to receive TCP/IP connections? Why are you normally required to bind a service to a specific port?

  Run the program specifying a small allocation block size

Run the program specifying a small allocation block size.

  Create a method called pterodactyl fly

Modify the world to use an event instead of a loop to make the pterodactyl fly while the world is running. You might need to refer back to Chapter 3, which covers events.

  Specific data warehouse product

While this case study supports a specific data warehouse product, please locate another case study from another data warehousing software company and explain the data warehouse that was designed in that case study?

  Ordered acquisition of synchronization objects

Write a short paper that recommends a deadlock avoidance approach most suitable for the TSI web server application that is not using an ordered acquisition of mutexes.

  Write a c program that swaps the first column of a matrix

Write a C program that swaps the first column of a matrix with the last column

  How many pages are needed to store the entire job

How many pages are needed to store the entire job?

  Briefly explain who a hacker is

Briefly explain who a hacker is and what the activities of a hacker are?

  State or federal public health agency

Can you do this assignment for me? Find at least two examples where a legal duty exists to report health data to a state or federal public health agency. Consider those relevant examples that have recently been reported in the news.

  Series of statements numbered in ascending order

An (old-style) BASIC program consists of a series of statements numbered in ascending order. Control is passed by use of a goto or gosub and a statement number.

  The development of cad and bim in architectural use

A brief history report about the development of CAD and BIM in architectural use supported with pictures and diagrams and perhaps a simple timeline. all in one A2 page. prefered page format is indesign.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd