
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:
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");
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.