
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.
The input and output formats for the date will be just the same as in Project 3. Your algorithm will be an extension of the one for Project 3 and your program could be a modification of the Project 3 program.
Do the program for this project two ways:
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.