The George Washington University
School
of Engineering and Applied Science
Department of Computer Science
CSci 51 -- Introduction to Software Development – Spring 2002
Project #3 -- Due Date: Start of Class, Tuesday, Feb 12, 2002

This project is an extension of Lab 4.

The goal is to give you more practice with nested loops, IF statements, and enumeration types.

Develop a Case Study for a program that will ask the user for an arbitrary starting date (within the range of Ada.Calendar), and an arbitrary ending date (in the same range), then output, to a file named "dates.out" a line for each day from the starting date to the ending date, inclusive. The starting and ending dates do not have to be in the same year. For example, if the user enters a starting date of May 1, 1999 and an ending date of September 15, 2002, the file will contain a line for each days in May through December of 1999, all of 2000, all of 2001, and all dates in 2002 through September 15. Remember, when turning in your results, be sure to include these output files in their complete and unedited form. This may mean that there will be several pages to turn in.

Your dates should be output in the following format: MAY 3, 2002The input format for the date will be the same as in Lab 4. 

Notes about Files:

Section 6.3 discusses input files, but here you need an output file. To create a file into which your program will write, your program will contain a variable declaration

MyFile: Ada.Text_IO.File_Type;

To associate the file name with a file in the file system, include this statement after the BEGIN of your program:

Ada.Text_IO.Create
  (File=>MyFile,Mode=>Ada.Text_IO.Out_File,Name=>"dates.out");
To write an integer value into this file, use the file-oriented Ada.Text_IO operations, for example, if Today is an integer variable, use

Ada.Integer_Text_IO.Put(File=>MyFile,Item=>Today,Width=>2);

When your program is finished, dates.out will be an ordinary text file in your directory, which you can read with vi, type out (cat) to the screen, print, download, or whatever.