IUP Computer Science
CO 300 Assembly Language
Spring 1994

Program #2 (Due 18 February 1994)

Write a program to calculate and display the distance (in terms of days) between two dates in 1994.

The program should ask the person at the terminal for two dates, a starting date and an ending date. The program should use prompts something like

     Which starting month?
     Which starting day?
to get the month number and day number of the first (starting) date. Similar prompts should be used to get the second (ending) date. The program may assume that both dates are valid; i.e., it does not have to check the dates for validity. However, your program must check to be sure the ending date is later in the year than the starting date. If it is not, the program must display an appropriate error message.

After reading in the two dates, the program must calculate and display the difference between the two dates (measured in days). The program must also display the difference between the two dates in weeks and days. Suppose that the starting date is 1/19 (January 19) and the ending date is 3/11 (March 11), then the two displays should look something like this.

     The difference in days is  51
     (or  7 weeks and 2 days)
The program must repeatedly ask for two dates and display the difference until the person at the terminal enters a zero when asked for the starting month number.

Hand in a .LIS file printout of your assembled program and a CARBONCOPY of a run of the program in which at least four pairs of dates are entered. The data that is entered for the CARBONCOPY should include one pair in which both dates are in the same month, one pair which are at least 250 days apart, and one pair in which the ending date is prior to the starting date.

DO NOT TRY TO CAPTURE THE .LIS FILE IN THE CARBONCOPY.