Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-05 - decus/20-0142/wkday.txt
There are 2 other files named wkday.txt in the archive. Click here to see a list.
















                 WKDAY.DAY

                     by

             JOSEPH K. WILLIAMS





This program will accept any date in the twentieth
century (1900 thru 1999) typed on the terminal, and
will display on the terminal the day of the week on
which it occurrs.  if the user misspells the name
of the month, a correct answer will be displayed if
the first three letters are correct.  A unique
algorithm is used such that the machine memory
requirement is nil.  Program prompts for all input
data and tests it for logical occurrence.  Should
a faulty date such as: June 36, 1987, be given, the
user is notified of the error and is again prompted
for input.  There is absolutely no restriction on
the number of inquires that can be made.  With
minor modifications, this program will run on any
FORTRAN machine.
EXAMPLES OF WKDAY.FOR PROGRAM EXECUTION FOLLOW:

1) CORRECT INPUT

   MONTH ? DECEMBER

     DAY ? 23

    YEAR ? 1978

 THE DATE: DEC 23, 1978 OCCURS ON A SATURDAY.

2) CORRECT INPUT EVEN THO MONTH IS MISSPELLED

   MONTH ? JANUUA

     DAY ? 31

    YEAR ? 1914

 THE DATE: JAN 31, 1914 OCCURS ON A MONDAY.

3) CORRECT INPUT, NOTE A LEAP YEAR

   MONTH ? FEBRUARY

     DAY ? 29

    YEAR ? 1976

 THE DATE: FEB 29, 1976 OCCURS ON A SUNDAY.

4) CORRECT INPUT, BUT WRONG DATE

   MONTH ? FEBR

     DAY ? 29

    YEAR ? 1979

 THAT IS AN IMPOSSIBLE DAY !