(Solved) : Write C Leap Year Second Year Program Whether Year Leap Year Leap Year Number Seconds Year Q42738337 . . .

Write this in c++

Leap year and Second in year program

  1. Whether a year is a leap year on not a leap year.
  2. The number of seconds in a year. (FYI, it will be a differentamount for leap vs non-leap year.) You can calculate the seconds bywhatever means you choose, whether with defined constants andcalculations or just calculations. It is your choice.
  3. If the user inputs a year number greater than zero, the programreturns how many seconds were or will be in that year.
  4. Put in descriptions for your request for input. If you do thebonus portion, also put that in for your request.
  5. Tell the user that an input of -99 ends the program. (+5)
    Put your prompt in a loop, asking the user each time what year tocheck. (+5)
  6. You should assume a day length of exactly 24 hours. Obviously,multiplying 365*24*3600 isn’t exactly a programming challenge, andit won’t even give the right answer for all years.
  7. You must take account of leap years, which means your yearswill not all have the same number of days. If you do not alreadyknow, here is the calculation for leap years:

1. If a year is divisible by 4 with no remainder, it is a leapyear,
2. unless it is a centurial year (ending in 00).
3. Then it is not a leap year,
4. unless it is a year divisible by 400, in which case it is stilla leap year.

For example:

1904 is a leap year—evenly divisible by 4.
1900 is not a leap year—it is evenly divisible by 4, and alsoevenly divisible by 100. However, it is not evenly divisible by400.
2000 is a leap year— it is evenly divisible by 4, evenly divisibleby 100, but also evenly divisible by 400.
Your calculation should ignore all other variations in the lengthof the calendar year, such as leap seconds or the change from theJulian to the Gregorian system.

Expert Answer

Answer to Write this in c++ Leap year and Second in year program Whether a year is a leap year on not a leap year. The number of s…

Leave a Comment


We are the best freelance writing portal. Looking for online writing, editing or proofreading jobs? We have plenty of writing assignments to handle.

Quick Links

Browse Solutions

Place Order

About Us

× How can I help you?