Doing a leap year project

Discussion in 'C++' started by rn216_ccc@comcast.net, Mar 29, 2007.

  1. Guest

    Hi there all,
    I found a web site,. http://www.onlineconversion.com/leapyear.htm,
    where it can give a list of leap years by within the given range by
    the user, or the user may enter a year and the program will make the
    decision if it is a leap year or not. In addition, I kind of
    understand that there are certain rules to calculating leap years. For
    instance, if the year is divisable by 4 and if the year is not
    divisable by 100 but is divisable by 400 then it is a leap year.
    However, what I wanted to know is do we actually have to wait 8 years
    when a calendar year falls on a centry year that is not divisable by
    400? For example, when I enter a range in the above given website,
    such as 1690 to the year 1710, I get the following list....

    1692, 1696, 1704, 1708'

    as you can see between 1696 and 1704 there is an eight year gap. Is
    that so?
    , Mar 29, 2007
    #1
    1. Advertising

  2. wrote:
    > [..] For example, when I enter a range in the above given website,
    > such as 1690 to the year 1710, I get the following list....
    >
    > 1692, 1696, 1704, 1708'
    >
    > as you can see between 1696 and 1704 there is an eight year gap. Is
    > that so?


    I am amazed by the amount of non-C++ questions here recently. What
    is it that compels you to ask about leap years in comp.lang.c++?
    AFAICT the year 1700 was supposed to be a leap year. If you didn't
    get it on that website you're writing about, how can we help here,
    in comp.lang.c++. Contact the administrator of that site and give
    him/her your grief about the bug in their software.

    V
    --
    Please remove capital 'A's when replying by e-mail
    I do not respond to top-posted replies, please don't ask
    Victor Bazarov, Mar 29, 2007
    #2
    1. Advertising

  3. Kai-Uwe Bux Guest

    wrote:

    > Hi there all,
    > I found a web site,. http://www.onlineconversion.com/leapyear.htm,
    > where it can give a list of leap years by within the given range by
    > the user, or the user may enter a year and the program will make the
    > decision if it is a leap year or not. In addition, I kind of
    > understand that there are certain rules to calculating leap years. For
    > instance, if the year is divisable by 4 and if the year is not
    > divisable by 100 but is divisable by 400 then it is a leap year.
    > However, what I wanted to know is do we actually have to wait 8 years
    > when a calendar year falls on a centry year that is not divisable by
    > 400? For example, when I enter a range in the above given website,
    > such as 1690 to the year 1710, I get the following list....
    >
    > 1692, 1696, 1704, 1708'
    >
    > as you can see between 1696 and 1704 there is an eight year gap. Is
    > that so?


    a) Yes. 1700 was not a leap year, and also 1500, 1800 and 1900 were not.
    1600 and 2000 were leap years.

    b) Your question is off-topic in this group. Even more: is appears to be
    completely unrelated to C++.


    Best

    Kai-Uwe Bux
    Kai-Uwe Bux, Mar 29, 2007
    #3
  4. Kai-Uwe Bux Guest

    Kai-Uwe Bux wrote:

    > wrote:
    >
    >> Hi there all,
    >> I found a web site,. http://www.onlineconversion.com/leapyear.htm,
    >> where it can give a list of leap years by within the given range by
    >> the user, or the user may enter a year and the program will make the
    >> decision if it is a leap year or not. In addition, I kind of
    >> understand that there are certain rules to calculating leap years. For
    >> instance, if the year is divisable by 4 and if the year is not
    >> divisable by 100 but is divisable by 400 then it is a leap year.
    >> However, what I wanted to know is do we actually have to wait 8 years
    >> when a calendar year falls on a centry year that is not divisable by
    >> 400? For example, when I enter a range in the above given website,
    >> such as 1690 to the year 1710, I get the following list....
    >>
    >> 1692, 1696, 1704, 1708'
    >>
    >> as you can see between 1696 and 1704 there is an eight year gap. Is
    >> that so?

    >
    > a) Yes. 1700 was not a leap year, and also 1500, 1800 and 1900 were not.
    > 1600 and 2000 were leap years.


    Correcting myself: 1500 was a leap year. The Gregorian Calendar patch was
    applied by early adopters in 1582.


    > b) Your question is off-topic in this group. Even more: is appears to be
    > completely unrelated to C++.
    >
    >
    > Best
    >
    > Kai-Uwe Bux
    Kai-Uwe Bux, Mar 29, 2007
    #4
  5. Howard Guest

    [OT] Re: Doing a leap year project

    "Victor Bazarov" <> wrote in message
    news:...
    > wrote:
    >> [..] For example, when I enter a range in the above given website,
    >> such as 1690 to the year 1710, I get the following list....
    >>
    >> 1692, 1696, 1704, 1708'
    >>
    >> as you can see between 1696 and 1704 there is an eight year gap. Is
    >> that so?

    >
    > I am amazed by the amount of non-C++ questions here recently. What
    > is it that compels you to ask about leap years in comp.lang.c++?
    > AFAICT the year 1700 was supposed to be a leap year. If you didn't
    > get it on that website you're writing about, how can we help here,
    > in comp.lang.c++. Contact the administrator of that site and give
    > him/her your grief about the bug in their software.
    >


    The year 1700 was not a leap year. In general, leap years are every year
    evenly divisible by 4. But, years evenly divisible by 100 are NOT leap
    years, unless they are also evenly divisible by 400.

    -Howard
    Howard, Mar 29, 2007
    #5
  6. Re: [OT] Re: Doing a leap year project

    Howard wrote:
    > "Victor Bazarov" <> wrote in message
    > news:...
    >> wrote:
    >>> [..] For example, when I enter a range in the above given website,
    >>> such as 1690 to the year 1710, I get the following list....
    >>>
    >>> 1692, 1696, 1704, 1708'
    >>>
    >>> as you can see between 1696 and 1704 there is an eight year gap. Is
    >>> that so?

    >>
    >> I am amazed by the amount of non-C++ questions here recently. What
    >> is it that compels you to ask about leap years in comp.lang.c++?
    >> AFAICT the year 1700 was supposed to be a leap year. If you didn't
    >> get it on that website you're writing about, how can we help here,
    >> in comp.lang.c++. Contact the administrator of that site and give
    >> him/her your grief about the bug in their software.
    >>

    >
    > The year 1700 was not a leap year. In general, leap years are every
    > year evenly divisible by 4. But, years evenly divisible by 100 are
    > NOT leap years, unless they are also evenly divisible by 400.


    That's by current definition. I didn't live in the year 1700 to know
    whether it actually was or wasn't leap. Did you? What sources do you
    use to know it "was not" a leap year? Apparently there are web sites
    that answer "was 1700 year a leap year?" differently.

    V
    --
    Please remove capital 'A's when replying by e-mail
    I do not respond to top-posted replies, please don't ask
    Victor Bazarov, Mar 29, 2007
    #6
  7. Kai-Uwe Bux Guest

    Re: [OT] Re: Doing a leap year project

    Victor Bazarov wrote:

    > Howard wrote:
    >> "Victor Bazarov" <> wrote in message
    >> news:...
    >>> wrote:
    >>>> [..] For example, when I enter a range in the above given website,
    >>>> such as 1690 to the year 1710, I get the following list....
    >>>>
    >>>> 1692, 1696, 1704, 1708'
    >>>>
    >>>> as you can see between 1696 and 1704 there is an eight year gap. Is
    >>>> that so?
    >>>
    >>> I am amazed by the amount of non-C++ questions here recently. What
    >>> is it that compels you to ask about leap years in comp.lang.c++?
    >>> AFAICT the year 1700 was supposed to be a leap year. If you didn't
    >>> get it on that website you're writing about, how can we help here,
    >>> in comp.lang.c++. Contact the administrator of that site and give
    >>> him/her your grief about the bug in their software.
    >>>

    >>
    >> The year 1700 was not a leap year. In general, leap years are every
    >> year evenly divisible by 4. But, years evenly divisible by 100 are
    >> NOT leap years, unless they are also evenly divisible by 400.

    >
    > That's by current definition. I didn't live in the year 1700 to know
    > whether it actually was or wasn't leap. Did you? What sources do you
    > use to know it "was not" a leap year? Apparently there are web sites
    > that answer "was 1700 year a leap year?" differently.


    Living in 1700, whether you would had considered it a leap year did depend
    on _where_ you lived. Adoption of the Gregorian Calendar started 1582 with
    a bunch of catholic countries. However, many countries still used the
    Julian Calendar in 1700. E.g., the Protestand German states adopted the
    Gregorian Calendar in 1699, just in time to get 1700 "right", however,
    England waited until 1752 and Greece until 1923.

    As for a source: I use the Encyclopedia Britannica.


    Best

    Kai-Uwe Bux
    Kai-Uwe Bux, Mar 29, 2007
    #7
  8. James Kanze Guest

    On Mar 29, 8:54 pm, "Howard" <> wrote:
    > "Victor Bazarov" <> wrote in message


    > news:...


    > > wrote:
    > >> [..] For example, when I enter a range in the above given website,
    > >> such as 1690 to the year 1710, I get the following list....


    > >> 1692, 1696, 1704, 1708'


    > >> as you can see between 1696 and 1704 there is an eight year gap. Is
    > >> that so?


    > > I am amazed by the amount of non-C++ questions here recently. What
    > > is it that compels you to ask about leap years in comp.lang.c++?
    > > AFAICT the year 1700 was supposed to be a leap year. If you didn't
    > > get it on that website you're writing about, how can we help here,
    > > in comp.lang.c++. Contact the administrator of that site and give
    > > him/her your grief about the bug in their software.


    > The year 1700 was not a leap year. In general, leap years are every year
    > evenly divisible by 4. But, years evenly divisible by 100 are NOT leap
    > years, unless they are also evenly divisible by 400.


    It depends on where you are. It was a leap year in the Julian
    calendar, but not in the Gregorian; in 1700, places like France
    used the Gregorian calendar (so it wasn't a leap year), but the
    Anglo-Saxon world didn't make the switch until 1752, so 1700
    would have been a leap year.

    If you're on a Unix machine, you might want to try the command
    "cal 9 1752". (The Unix cal program has never been
    internationalized, and so always prints the calendar for the
    United States, regardless of where one actually is.)

    See for example
    http://scienceworld.wolfram.com/astronomy/GregorianCalendar.html
    or http://webexhibits.org/calendars/year-definitions.html.

    --
    James Kanze (GABI Software) email:
    Conseils en informatique orientée objet/
    Beratung in objektorientierter Datenverarbeitung
    9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
    James Kanze, Mar 30, 2007
    #8
  9. Howard Guest

    Re: [OT] Re: Doing a leap year project

    "Kai-Uwe Bux" <> wrote in message
    news:euhc99$77j$...
    > Victor Bazarov wrote:
    >


    >> That's by current definition. I didn't live in the year 1700 to know
    >> whether it actually was or wasn't leap. Did you? What sources do you
    >> use to know it "was not" a leap year? Apparently there are web sites
    >> that answer "was 1700 year a leap year?" differently.

    >
    > Living in 1700, whether you would had considered it a leap year did depend
    > on _where_ you lived. Adoption of the Gregorian Calendar started 1582 with
    > a bunch of catholic countries. However, many countries still used the
    > Julian Calendar in 1700. E.g., the Protestand German states adopted the
    > Gregorian Calendar in 1699, just in time to get 1700 "right", however,
    > England waited until 1752 and Greece until 1923.
    >
    > As for a source: I use the Encyclopedia Britannica.


    1700 was a looong time ago, so I'm not sure exactly where I was living then.
    Perhaps my servant Renfield recalls...

    -H
    Howard, Mar 30, 2007
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hai Nguyen

    Date Validation Expression and Leap Year

    Hai Nguyen, Feb 26, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    3,311
    Hans Kesting
    Feb 27, 2004
  2. Wen
    Replies:
    4
    Views:
    461
    Simon Saunders
    Dec 12, 2003
  3. Protoman
    Replies:
    14
    Views:
    541
  4. Replies:
    39
    Views:
    1,609
    Charlie Gordon
    Nov 12, 2007
  5. ase
    Replies:
    0
    Views:
    1,060
Loading...

Share This Page