Best I can tell, now that I'm at home and have a had a chance to look at this, the code itself is simply buggy somewhere.
The reason why we're not seeing any date being printed, is simply because we're not generating a day value from 1 to 7, as I illustrate here:
20 PRINT TAB(15);
"CREATIVE COMPUTING MORRISTOWN, NEW JERSEY" 100 PRINT "WEEKDAY IS A COMPUTER DEMONSTRATION THAT" 110 PRINT "FROM FACTS ON A DATE OF INTEREST FOR YOU." 130 PRINT "ENTER THE DATE OF TODAY IN THE FORM: 3,24,1979 ";
150 REM THIS PROGRAM DETERMINES THE DAY OF THE WEEK
240 PRINT "ENTER DAY OF BIRTH (OR OTHER DAY OF INTEREST)";
250 INPUT M
, D
, Y
'let's say I'm going to use 1, 1, 2021 270 LET I1
= INT((Y
- 1500) / 100) 'so 5 for 2021? 280 REM TEST
FOR DATE BEFORE CURRENT CALENDAR.
300 LET A
= I1
* 5 + (I1
+ 3) / 4 '5 * 5 + 8 / 4 = 25 + 2 = 27 310 LET I2
= INT(A
- fnb
(A
) * 7) 'int (27 - 6 * 7) = 27 - 42 = -15 330 LET Y3
= INT(Y
- Y2
* 100) 'int(2021 - 20 * 100) = 21 340 LET A
= Y3
/ 4 + Y3
+ D
+ T
(M
) + I2
'WAIT?? WHAT?? Why did we calculate A before, just to replace it completely here?? ' A = 21 / 4 + 21 + 1 + T(M) + (-15)
' T(1) = 0 for the above, so A = 5 + 21 + 1 + 0 - 15
' Which makes A = 12?
350 LET B
= INT(A
- fnb
(A
) * 7) + 1 '12 - 3 * 7 = `12 - 21 = -9 360 IF M
> 2 THEN 470 'month is only 1; skip this 370 IF Y3
= 0 THEN 440 'y3 is 21; skip this 380 LET T1
= INT(Y
- fna
(Y
) * 4) 'T1 = 2021 - 504 * 4 = 1 390 IF T1
<> 0 THEN 470 'T1 = 1, so we goto 470 450 LET T1
= INT(A
- fna
(A
) * 4) 470 IF B
<> 0 THEN 490 'B = -9, so we goto 490 490 IF (Y1
* 12 + M1
) * 31 + D1
< (Y
* 12 + M
) * 31 + D
THEN 550 'these just gives us a formatting for grammer 500 IF (Y1
* 12 + M1
) * 31 + D1
= (Y
* 12 + M
) * 31 + D
THEN 530 'both end up going to 570 510 PRINT M;
"/"; D;
"/"; Y;
" WAS A "; B
530 PRINT M;
"/"; D;
"/"; Y;
" IT'S A "; B
550 PRINT M;
"/"; D;
"/"; Y;
" IT WILL BE A "; B
560 REM PRINT THE DAY OF THE WEEK THE DATE FALLS
ON.
570 IF B
<> 1 THEN 590 '-9 is not 1, so goto 590 590 IF B
<> 2 THEN 610 '-9 is not 2, so goto 610 610 IF B
<> 3 THEN 630 '-9 is not 3, so goto 630 630 IF B
<> 4 THEN 650 '-9 is not 4, so goto 650 650 IF B
<> 5 THEN 670 '-9 is not 5, so goto 670 670 IF B
<> 6 THEN 690 '-9 is not 6, so goto 690 690 IF B
<> 7 THEN 710 '-9 is not 7, so goto 710 710 IF (Y1
* 12 + M1
) * 31 + D1
= (Y
* 12 + M
) * 31 + D
THEN 1120 840 PRINT "***HAPPY BIRTHDAY***" 850 PRINT " ", " ", "ANNI", "MESI", "GIORNI" 855 PRINT " ", " ", "-----", "------", "----" 860 PRINT "LA TUA ETA ", I5
, I6
, I7
870 LET A8
= (I5
* 365) + (I6
* 30) + I7
+ INT(I6
/ 2) 910 REM CALCULATE RETIREMENT DATE.
930 REM CALCULATE TIME SPENT IN THE FOLLOWING FUNCTIONS.
950 PRINT "HAI DORMITO ", 980 PRINT "TU HAI MANGIATO ", 1020 PRINT "HAI GIOCATO", 1050 PRINT "HAI GIOCATO / STUDIATO", 1070 PRINT "HAI LAVORATO / GIOCATO", 1090 PRINT "TI SEI RILASSATO ", K5
, K6
, K7
1110 PRINT TAB(16);
"*** PUOI ANDARE IN PENSIONE"; E;
" ***" 1280 PRINT "FRIDAY THE 13TH -- ATTENTION!" 1300 PRINT "NON PREPARATI A DARE GIORNO DELLA SETTIMANA PRIMA DI MDLXXXII. " 1320 REM TABLE OF VALUES
FOR THE MONTHS
TO BE USED IN CALCULATIONS.
1330 DATA 0,3,3,6,1,4,6,2,5,0,3,5 1340 REM THIS
IS THE CURRENT DATE USED IN THE CALCULATIONS.
1350 REM THIS
IS THE DATE
TO BE CALCULATED
ON.
1360 REM CALCULATE TIME IN YEARS
, MONTHS
, AND DAYS
1390 LET K1
= K1
- (I5
* 365) 1410 LET I7
= K1
- (I6
* 30)
By running the program, we generate a B value for the day, and our calculation ends up returning negative values to us. (For 1/1/2021, the value ends up telling us that our day is the -9th day, which is completely meaningless.) Now, what's glitched here, I have no clue. Perhaps, it's like STx has suggested and one of the FUNCTIONS is wrong, or perhaps it's something else completely. If you've translated this code from some original QB45 source, kindly share the source so we can compare the two versions, otherwise, I'm afraid, about all you can get here is some basic confirmation: "Yep, it's buggy."
The IF statements work fine; but there's something in the math that simply doesn't compute properly, as written.