All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Algorithms
Fifth Thursdays (Posted on 2003-10-06) Difficulty: 3 of 5
You have a club that meets the fourth Thursday of each month, and another one that meets the last Thursday of each month. Usually you have to choose to attend one meeting or the other as the fourth Thursday of the month is usually the last Thursday of the month. However, some months have five Thursdays. In those months you can attend both meetings.

Develop an algorithm to find all the fifth Thursdays of those months that have them, and set it to calculate them for ten years. You are given subroutines that convert Gregorian calendar dates to and from JD numbers, which are the number of days a given date is past a certain fixed date in the distant past (more than 6000 years ago). You also have a 2003 calendar available that tells you Jan. 2, 2003 was a Thursday.

See The Solution Submitted by Charlie    
Rating: 3.4000 (5 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
A few thoughts.. | Comment 1 of 2
There are at least 52 Thursdays in a year, every month has at least 4 Thursdays. Then, there are at least 4 (52 - 12 * 4) Thursdays which occur as the 5th Thursday of a month.
Edited on October 7, 2003, 2:54 pm
  Posted by Brian Smith on 2003-10-07 14:53:33
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (13)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information