ChipMaster's bwBASIC This also includes history going back to v2.10. *WARN* some binary files might have been corrupted by CRLF.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

41 lines
2.0 KiB

  1. 1 REM DAYYEAR
  2. 4 CLEAR 1000:CLS
  3. 10 DIM M$(15),S(15)
  4. 15 DEFINT L
  5. 20 PRINT TAB(15); "DAY OF YEAR"
  6. 30 PRINT:PRINT"GIVEN THE MONTH AND DAY OF A PARTICULAR DATE IN THE YEAR
  7. 40 PRINT"THIS PROGRAM WILL CALCULATE ON WHICH DAY OF THE YEAR THAT DATE
  8. 50 PRINT"OCCURS. FOR EXAMPLE 02/15 IS THE 46 TH DAY OF THE YEAR. FOR
  9. 60 PRINT"ALL DATES AFTER FEBRUARY 28 THE PROGRAM PRINTS 2 ANSWERS, ONE
  10. 70 PRINT"FOR A LEAP YEAR AND ONE FOR NON-LEAP YEARS."
  11. 75 PRINT"THE PROGRAM ALSO GIVES THE NUMBER OF DAYS FROM THE PRESENT
  12. 80 PRINT"DATE TO THE PREVIOUSLY ENTERED DATE. A NEGATIVE HERE MEANS
  13. 85 PRINT"THAT THE PRESENT DATE COMES LAST. THIS PART OF THE PROGRAM
  14. 90 PRINT"GIVES AN INCORRECT ANSWER FOR FEBRUARY 29 DURING LEAP YEAR.
  15. 95 PRINT:INPUT"PRESS ENTER TO BEGIN";Z9$
  16. 97 FOR LL=1 TO 12:READ M$(LL):NEXT:REM READ MONTHS IN
  17. 98 FOR LL=1 TO 13:READ S(LL):NEXT:REM READ 1ST DAY OF MONTH DATA
  18. 100 CLS
  19. 110 INPUT"ENTER MONTH OF DESIRED DATE IN NUMERICAL MM FORM";MM
  20. 115 IF MM<1 OR MM>12 OR MM<>INT(MM) THEN GOSUB 10000:GOTO 110
  21. 120 PRINT"ENTER DAY OF ";M$(MM);" DESIRED";:INPUT DD
  22. 125 IF MM=2 AND DD=29 THEN GOTO 150
  23. 130 IF DD<>INT(DD) OR DD<1 OR DD>S(MM+1)-S(MM) THEN GOSUB 10000:GOTO 120
  24. 150 PRINT:PRINT
  25. 160 PRINT M$(MM);DD;" IS DAY NUMBER ";S(MM)+DD;" OF THE YEAR."
  26. 170 PRINT
  27. 180 IF MM>2 THEN PRINT "DURING A LEAP YEAR "; M$(MM);DD;" IS DAY NUMBER ";S(MM)+DD+1;" OF THE YEAR."
  28. 182 PRINT:PRINT"NUMBER OF DAYS FROM LAST DATE = ";S(MM)+DD-JR
  29. 183 IF JM<=2 AND MM>2 THEN PRINT"NUMBER OF DAYS FROM LAST DATE DURING LEAP YEAR = ";S(MM)+DD+1-JR
  30. 184 IF JM>2 AND MM<=2 THEN PRINT"NUMBER OF DAYS FROM LAST DATE DURING LEAP YEAR = ";S(MM)+DD-JR-1
  31. 185 JR=S(MM)+DD:JM=MM
  32. 190 PRINT:PRINT
  33. 195 INPUT"PRESS ENTER FOR MORE COMPUTATIONS";Z9$
  34. 197 IF Z9$ = "-1" THEN END
  35. 199 GOTO 100
  36. 900 DATA JANUARY,FEBRUARY,MARCH,APRIL,MAY,JUNE,JULY,AUGUST
  37. 910 DATA SEPTEMBER,OCTOBER,NOVEMBER,DECEMBER
  38. 920 REM NO. OF DAYS TO FIRST DAY OF MONTH DATA
  39. 930 DATA 0,31,59,90,120,151,181,212,243,273,304,334,365
  40. 10000 PRINT"INPUT ERROR! TRY AGAIN":FOR JJ=1 TO 300:NEXT:RETURN