Loading ...
Sorry, an error occurred while loading the content.

Sample Tomy Tutor BASIC Program - 30 Days Hath September

Expand Messages
  • Mario
    TOMY TUTOR SAMPLE BASIC PROGRAM: 30 DAYS HATH SEPTEMBER There is a simple poem to help you remember the number of days in any month: Thirty days hath
    Message 1 of 1 , Mar 26, 2010
    View Source
    • 0 Attachment
      TOMY TUTOR SAMPLE BASIC PROGRAM:

      30 DAYS HATH SEPTEMBER

      There is a simple poem to help you remember the number of days in any month:

      Thirty days hath September,
      April, June and November.
      All the rest have thirty-one.
      Except February alone.
      Which has four plus twenty-four.
      And every leap year one day more.

      This program will also help you - unless it's a leap year!

      10 INPUT "TYPE IN THE MONTH NUMBER (1-12):" :M
      20 IF M>12 THEN 10
      30 PRINT "MONTH NUMBER ";M;" HAS ";
      40 ON M GOTO 70,90,70,50,70,50,70,70,50,70,50,70
      50 PRINT 30;
      60 GOTO 100
      70 PRINT 31;
      80 GOTO 100
      90 PRINT 28;
      100 PRINT " DAYS."
      110 END

      For fun, add a warning message when M=2 that "February sometimes has 29 days."

      ~Ben
    Your message has been successfully submitted and would be delivered to recipients shortly.