The George Washington University
School of Engineering and Applied Science
Department of Computer Science

CSci 51 -- Introduction to Computing -- Spring 2001

Project #3
Due Date: Start of Class, Tuesday, Feb 20, 2001

The purpose of this project is to give you more practice developing a Case Study and an associated program, starting from a "word problem".

Everything you need is in Chapters 1-5; you need not, and should not, use any "extra" statements or anything from later chapters.

Background: The so-called "Y2K bug" or "Y2K problem" arising when the year 1999 ended and 2000 began, was actually a set of computer problems.

The most publicized one was the representation, in old programs and data files, of the year as a 2-digit number. This caused some programs to fail to distinguish between 1900 and 2000. The 2-digit representation was not really a bug, because it was designed to save computer memory at a time when memory was very expensive. Changing the representation to 4 digits was very expensive for the industry, but it had to be done.

A less-publicized problem -- to which this project is related -- was a real bug: some programs were improperly coded, and failed to distinguish between valid dates and invalid ones, especially because 2000 was a leap year.

Project: The requirement is to provide a program that will allow the user to input a date, then determine and display whether that date is valid. The date will be represented as three positive integers Month, Day, and Year, and will lie between January 1, 1000 and December 31, 3000. A date is valid if and only if the month, day, and year are in the proper ranges, and combine to produce a date that really is a part of our calendar. For example, Feb. 29, 2000 is valid, Feb. 29, 2001 is not valid, Aug. 31, 2000 is valid, Sept. 31, 2000 is not, etc.

You cannot use any Ada.Calendar operations (because that package only handles years in 1901..2099). Also, do not use any subtypes other than Positive; your program must do its own range testing on the inputs, and your own validity checking on the dates..

What to submit: See the document Preparation and Grading of Programming Projects for details.