The George Washington University
School of Engineering and Applied Science
Department of Computer Science
CSci 51 -- Introduction to Software Development -- Spring 2000
Project #5 -- Due Date: Start of Class, Tuesday, March 6, 2000

This project uses material from Chapters 1-6. The objective is to practice using packages, interesting FOR loops, and files.

Develop a Case Study for a program that will ask the user for an arbitrary starting date between Jan. 1, 1000 and Dec. 31, 3000, then output, to a file named "dates.out", one 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 day in May through December of 1999, all of 2000, all of 2001, and all dates in 2002 through September 15.

The input format and output formats for the dates will be mm/dd/yyyy. Your program will proceed to write the file if and only if the two input dates are valid and the starting date is earlier than the ending date. The program will write one of four completion messages to the screen:

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.

What to submit:

The deliverable for this project is an end-user program, so the usual Case Study submission rules apply.