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

  What is the intent of regulatory compliance

What is the intent of regulatory compliance, and what is the role of IT in maintaining corporate compliance?

  Team collaboration for schedules

Based on the ideas offered throughout Chapter 7, as well as your own insight and experience, briefly examine at least five benefits a project team is likely to gain if members collaborate in developing a project schedule. Support your examination ..

  Decide to create a location tracking service

We decide to create a "location tracking" service so that we can track our friends' GPS locations with a time granularity of 5 minutes. Each person who subscribes to the service is given a domain name, [email protected] , and there is a LT (location tra..

  Difference between kernel and user mode

What is the difference between kernel and user mode? Explain how having two distinct modes aids in designing an operating system.

  What if three connections are chosen at random

Suppose we choose two connections through this combined switch at random. What is the probability that both connections can be forwarded in parallel? Hint: This is the probability that at most one of the connections crosses the link.

  Inherent method of tracking state or managing sessions

Session management is used to track user activity, including the login and logout (or the beginning and end of a user session) of a Web application, otherwise known as "state." Because HTTP is a stateless technology, HTTP has no inherent method of tr..

  Would this be a plausible way of compressing text

With the quality setting at 100, would this be a plausible way of compressing text?

  Example of a binomial or trinomial expression

Choose one of the forms above. In your own words, explain the pattern that allows you to recognize the binomial or trinomial as having special factors.  Then provide an example of a binomial or trinomial expression that may be factored using the s..

  Practices for access control methods

What are some of industry's best practices for access control methods? What are some common access control models and the differences between each?

  Secure company-wide network infrastructure

The case study company (Soulmate Ventures) has expressed a desire to have a secure company-wide network infrastructure. Because the network has to revaluated from the beginning, the company wants to ensure that the new network has as many reasonab..

  Formulate the interconnection function for the omega network

Formulate the interconnection function for the Omega network

  Online search for a good or service offered

Online search for a good or service offered in another country

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