
Everything you need is in Chapters 1-6; you need not, and should not, use any "extra" statements or anything from later chapters. Also, do not use subtypes (except Positive) in this project; we will start using other types and subtypes in Project 5.
Background: Input data validation is a very important part of software development, and many date validation operations are required often enough in programs that it makes sense to package them up for repeated use. Your date-validation algorithm from Project 3 is one of these common problems, so this project will give you a chance to use that algorithm (and maybe part of the associated code as well) as part of a reusable software component (which is called a package in Ada) containing date operations.
Project: The requirement is to develop and test a package containing two date operations, and a "test harness" program designed to demonstrate that the operations behave correctly. Here is the package specification, which is online in the file date_ops.ads.
PACKAGE Date_Ops IS ------------------------------------------------------------------------ --| Specification for package containing a few common date operations. --| Author: Michael B. Feldman, The George Washington University --| Last Modified: February 2001 ------------------------------------------------------------------------
FUNCTION IsValidDate (Month: Positive; Day: Positive; Year: Positive) RETURN Boolean; -- Pre: Month, Day, and Year have well-defined values -- Post: returns True if the three parameters together form a date that -- is valid for years in the range 1000 to 3000, False otherwise
FUNCTION IsEarlier (Month1: Positive; Day1: Positive; Year1: Positive; Month2: Positive; Day2: Positive; Year2: Positive) RETURN Boolean; -- Pre: All six parameters have well-defined values, and each of the -- two sets of parameters forms a valid date -- Post: returns True if the date formed by Month1, Day1, Year1 is -- earlier than the date formed by MOnth2, Day2, Year2, and -- False otherwise
END Date_Ops;The file date_ops.adb contains a skeleton implementation of this package. The functions are written as stubs. That is, they will compile correctly but not yet do anything useful. Both stub functions just return False. It is common in software development that in the early stages of developing a component, some of the operations in it are "stubbed out" like this. You can use this skeleton as a starting point for your own package body.
What to submit: See the document Preparation and Grading of Programming Projects for details. Your test plan and associated test program should include a proper set of tests for each of the two functions.