10 PRINT "DAY OF THE WEEK"
20 PRINT
29 REM - REQUEST USER INPUT
30 PRINT "(ENTER 0,0,0 TO END PROGRAM)"
40 PRINT "MONTH, DAY, YEAR (EX. 8,2,1979)";
50 INPUT M,D,Y
59 REM - TEST FOR END OF PROGRAM
60 IF M<>0 THEN 100
70 IF D<>0 THEN 100
80 IF Y<>0 THEN 100
90 GOTO 360
99 REM - NEED TO ADJUST INPUT FOR CALCULATIONS?
100 IF M>2 THEN 130
109 REM - ADJUST INPUT
110 M=M+12
120 Y=Y-1
129 REM - CALCULATE DAY NUMBER
130 N=D+2*M+INT(.6*(M+1))+Y+INT(Y/4)-INT(Y/100)+INT(Y/400)+2
140 N=INT((N/7-INT(N/7))*7+.5)
149 REM - FIND CORRECT DAY NUMBER, TRANSLATE TO DAY, PRINT
150 IF N>0 THEN 180
160 PRINT "SATURDAY"
170 GOTO 340
180 IF N>1 THEN 210
190 PRINT "SUNDAY"
200 GOTO 340
210 IF N>2 THEN 240
220 PRINT "MONDAY"
230 GOTO 340
240 IF N>3 THEN 270
250 PRINT "TUESDAY"
260 GOTO 340
270 IF N>4 THEN 300
280 PRINT "WEDNESDAY"
290 GOTO 340
300 IF N>5 THEN 330
310 PRINT "THURSDAY"
320 GOTO 340
330 PRINT "FRIDAY"
340 PRINT
349 REM - RESTART PROGRAM
350 GOTO 40
360 END
