473,602 Members | 2,792 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Doing a leap year project

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 '07 #1
8 2960
rn*******@comca st.net 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
Mar 29 '07 #2
rn*******@comca st.net 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
Mar 29 '07 #3
Kai-Uwe Bux wrote:
rn*******@comca st.net 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
Mar 29 '07 #4

"Victor Bazarov" <v.********@com Acast.netwrote in message
news:2o******** *************** *******@comcast .com...
rn*******@comca st.net 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

Mar 29 '07 #5
Howard wrote:
"Victor Bazarov" <v.********@com Acast.netwrote in message
news:2o******** *************** *******@comcast .com...
>rn*******@comca st.net 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
Mar 29 '07 #6
Victor Bazarov wrote:
Howard wrote:
>"Victor Bazarov" <v.********@com Acast.netwrote in message
news:2o******* *************** ********@comcas t.com...
>>rn*******@comca st.net 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
Mar 29 '07 #7
On Mar 29, 8:54 pm, "Howard" <alic...@hotmai l.comwrote:
"Victor Bazarov" <v.Abaza...@com Acast.netwrote in message
news:2o******** *************** *******@comcast .com...
rn216_...@comca st.net 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
internationaliz ed, and so always prints the calendar for the
United States, regardless of where one actually is.)

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

--
James Kanze (GABI Software) email:ja******* **@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientier ter Datenverarbeitu ng
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

Mar 30 '07 #8

"Kai-Uwe Bux" <jk********@gmx .netwrote in message
news:eu******** **@murdoch.acc. Virginia.EDU...
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

Mar 30 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
4751
by: Protoman | last post by:
Hi!!! I need some help on a project I'm that calculates leap years; I'm getting errors that I have no idea what they mean; here's the code: #include <iostream> #include <cstdlib> using namespace std; class Year { public:
22
4419
by: deepak.rathore | last post by:
can someone give the regular expr. to validate leap yr like 02/29/2000,02/29/00 Thanks
2
5022
by: owz | last post by:
Ok, I am making a program (java class file) 2 work out if a date entered is valid or invalid for the day, month year, and for leap years.. dd/mm/yyyy . I seem 2 have gotten it 2 validate the year and month, but my code errors on the day validation. Error(91,38): variable daysInMonth might not have been initialized. Any thoughts, all help welcome. I only ask as a last resort as it is frustrating me 2 pulling my hair out.
3
3643
by: xGx | last post by:
Hi please could someone help. i have created this programming so you can work out if there is a LEAP YEAR. But i need it to handle centuries. heres the code def isLeapYear (year): result = year % 4 if result > 0: print "It is NOT a leap year" else: print "It IS a leap year"
8
3903
by: SONIQ | last post by:
You can determine whether a year is a leap year by testing if it is divisible by 4. However, years that are also divisible by 100 are not leap years, unless they are also divisible by 400, in which case they are leap years. Write a script that allows a user to enter a year and then determine whether the year entered is a leap year. Include a form with a single text box where the user can enter a year. Display an alert dialog box to the user...
12
7671
by: Brigitte Behrmann | last post by:
Can anyone assist with my code. I just cannot get this to work: I have to write a script that allows the user to enter a year & then determine whether it is a leap year or not. The request is for a form with a single text box and using an alert dialog box stating if the entered year is a standard or leap year. Code so far: <HTML> <HEAD> <TITLE>Is it a leap year?</TITLE> </HEAD> <SCRIPT LANGUAGE="JAVASCRIPT>
37
14929
by: mazwolfe | last post by:
I'm new here, so excuse me if my style is incorrect. Can anyone come up with a better method for this calculation? Code: int is_leap(int year) { switch (year % 19) { case 0: case 3: case 6: case 8: case 11: case 14: case 17: return 1; default: return 0;
5
3484
by: jimix | last post by:
here's what i have. using microsoft studio #define _CRT_SECURE_NO_DEPRECATE #include <stdio.h> int main( void ) { int year, b, c, e; b = 4; c = 100;
4
4415
by: hallsers | last post by:
Here is the problem i am having: - When a user logs in, on page load it will take the dob of all users in a stored friends list and compare them against the following conditions - To display any friends with a birthday inside the next 3 days, taking into account leap years for some1 born on the 29th of feb to be born on 28th in non leap years and also to display their age with the reminder. Here is code i have picked up so far. 1. ...
0
7993
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7920
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8054
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8268
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6730
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5440
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3900
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3944
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1254
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.