Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to write a small and easy program: PLEASE HELP 3

Status
Not open for further replies.

silentAssassin

Programmer
Mar 12, 2001
12
US
Ok, I am currently in a beginners C++ Class. I need help writing the following practice problem:

Write a loop that calls a funciton to generate a year between 1895 and 2010. Test the year for being a leap year and print an appropriate statement to the screen. The loop should run at least five times.


I do not even know where to start. Don't worry, this problem is for practice only. I would just like to see the script so I can know what I am doing when we do some other problem for a grade.
 
Glad I was able to help (some, anyway :) )

A book you might want to order is:
Practical Algorithms for Programmers
ISBN: 020163208X
By Andrew Binstock & John Rex.

It has an entire chapter devoted to date/time calculations, and a good history as to how they got so screwed up (it involves a Monk, two Popes, and a King or three).

Besides this, it's a terrific reference for trees, linked-lists, string searching, and sorting. A must-have. Code is in C, not C++, but it ought to be understandable.

Chip H.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top