Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-01 - decus/20-0024/tutr02.bas
There are 2 other files named tutr02.bas in the archive. Click here to see a list.
00001REM   TUT2
00110PRINT"WELL, I'M GLAD YOU MADE IT. I'VE BEEN WAITING FOR YOU SO THAT"
00120PRINT"WE COULD CONTNUE OUR LESSON.  SO FAR WE HAVE COVERED THE"
00130PRINT"'INPUT' STATEMENT, THE 'LET' STATEMENT (AND ITS SYMBOLS), AND"
00140PRINT"THE 'PRINT' STATEMENT. OUR SAMPLE PROGRAM LOOKS LIKE THIS:"
00150PRINT
00160PRINT"10 INPUT X, Y, Z"
00170PRINT"20 LET R = SQR (X^2 + Y^2 + Z^2)"
00180PRINT"30 PRINT R"
00190PRINT"40 END"
00200PRINT
00210PRINT"WE CAN DO MUCH MORE WITH THE 'PRINT' STATEMENT: BESIDES PRINTING"
   00220PRINT"THE VALUE OF A VARIABLE OF INTEREST (IN OUR CASE, 'R') IT CAN ALSO"
00230PRINT"BE USED TO TYPE OUT LABELS.  ANYTHING IN QUOTES FOLLOWING THE"
00240PRINT"'PRINT' STATEMENT WILL BE TYPED OUT LITERALLY. SO WE ADD:"
00250PRINT
00260PRINT"30 PRINT ''THE RADIUS VECTOR EQUALS'';R"
00270PRINT
00280PRINT"BY USING STATEMENT NUMBER 30, THIS WILL REPLACE THE EARLIER ONE"
00290PRINT"AND THIS IS THE WAY WE CAN CORRECT OUR PROGRAM. THE PHRASE IN"
00300PRINT"QUOTATION MARKS WILL 'LABEL' OUR VALUE OF R WHICH FOLLOWS."
00310	PRINT"NOTE THE ';' IS USED AS A SEPARATOR.)"
00320	PRINT"WE CAN DO THE SAME KIND OF THING TO THE FRONT OF OUR PROGRAM"
00330PRINT"TO EXPLAIN IT TO A USER:"
00340PRINT
00350PRINT"9 PRINT ''WHAT ARE YOUR VALUES OF X,Y, AND Z''"
00360PRINT
00370PRINT" (THE 'INPUT' STATEMENT WHICH FOLLOWS WILL SUPPLY THE ?)"
00380PRINT"NOTICE THE '9' STATEMENT NUMBER: THIS WILL BE EXECUTED BEFORE"
00390PRINT"THE 'INPUT' STATEMENT IN '10'. THIS DEMONSTRATES WHY IT IS SO"
00400PRINT"HANDY TO NUMBER STATEMENTS IN INCREMENTS. OUR NEW PROGRAM NOW"
00410PRINT"LISTS AS FOLLOWS:"
00420	PRINT
00430	PRINT"9 PRINT ''WHAT ARE YOUR VALUES OF X, Y, AND Z''"
00440PRINT"10 INPUT X, Y, Z"
00450PRINT"20 LET R = SQR (X^2 + Y^2 + Z^2)"
00460PRINT"30 PRINT ''THE RADIUS VECTOR EQUALS'';R"
00470PRINT"40 END"
00480PRINT
00490PRINT"WHEN 'RUN' IS TYPED THE PROGRAM DOES THIS:"
00500PRINT
00510PRINT"WHAT ARE YOUR VALUES OF X, Y, AND Z"
00520PRINT"?    (TRY IT: TYPE 3 NUMBERS SEPARATED BY COMMAS)"
00530INPUT X, Y, Z
00540PRINT"THE RADIUS VECTOR EQUALS";SQR(X^2+Y^2+Z^2)
00550PRINT
00560PRINT
00570PRINT
00580	PRINT
00590	PRINT"NOW, IF YOU HAVE A STRING OF VALUES TO COMPUTE AND WANT TO"
00600PRINT"AUTOMATICALLY REPEAT A PORTION OF YOUR PROGRAM YOU CAN DO THIS BY"
00610PRINT"USING THE STATEMENT:"
00620PRINT
00630PRINT"35 GO TO 9"
00640PRINT
00650PRINT"THIS WILL CAUSE THE COMPUTER TO RETURN TO THE BEGINNING AND"
00660PRINT"REPEAT AS LONG AS YOU HAVE VALUES OF X, Y, AND Z TO TYPE IN."
00670PRINT"(TYPING THE WORD 'STOP' WILL HALT THE PROGRAM.)"
00680PRINT"   A FEW FINAL ITEMS AND I'LL TURN YOU LOOSE TO TRY YOUR OWN HAND"
00690PRINT"AT WRITING A PROGRAM. WHENEVER YOU START A NEW PROGRAM"
             00700PRINT"YOU TELL THE SYSTEM BY TYPING 'NEW'. THE SYSTEM WILL THEN ASK"
00710PRINT"YOU FOR A NAME (BY WHICH IT WILL BE FILED).  UP TO 6 LETTERS CAN"
00720PRINT"BE USED (NUMBERS MAY ALSO BE USED FOLLOWING THE FIRST LETTER)."
00730PRINT"IF YOU WANT TO STORE IT AFTER WORKING WITH IT AWHILE YOU SIMPLY"
00740PRINT"TYPE THE WORD,"
00750PRINT
00760PRINT"SAVE"
00770PRINT
00780PRINT"THE SYSTEM WILL STORE THE PROGRAM UNDER YOUR USER NUMBER AND"
00790PRINT"YOU CAN RECALL IT LATER BY TYPING 'OLD' AND CALLING IT BY THE"
00800PRINT"LABEL YOU ASSIGNED. (IF YOU FORGET THE LABELS IN YOUR FILE,"
        00810PRINT"TYPE '$C' AND THE SYSTEM WILL LIST THE PROGRAMS SAVED UNDER"
00820PRINT"YOUR USER NUMBER.) IF YOU WANT TO REMOVE A PROGRAM FROM YOUR "
00830PRINT"FILE, CALL IT FROM THE FILE WITH 'OLD'. THE SYSTEM WILL ASK FOR"
00840PRINT"A PROGRAM NAME, YOU TYPE THE NAME OF THE PROGRAM TO BE REMOVED."
00850PRINT"AFTER THE COMPUTER TYPES '*' THEN YOU TYPE:"
00860PRINT
00870PRINT"UNSAVE"
00880PRINT
00890PRINT"WHEN YOU WANT TO SIGN OFF, AFTER THE COMPUTER TYPES"
00900	PRINT"AN '*' THEN YOU TYPE 'BYE'."
00910	PRINT" YOU HAVE NOW COMPLETED ANOTHER LESSON WITH YOUR COMPUTER"
00920PRINT"TUTOR AND ARE READY TO TRY A FEW THINGS ON YOUR OWN."
00930PRINT"THE BEST WAY TO BECOME COMFORTABLE WITH THE SYSTEM IS TO TRY"
00940PRINT"IT ON SOME OF YOUR OWN PROBLEMS.  DON'T HESITATE TO CALL ON THE"
00950 PRINT "PROFESSIONAL STAFF OF ON-LINE SYSTEMS, INC. FOR ANY"
00960PRINT"ASSISTANCE YOU REQUIRE.  INCIDENTALLY, YOU CAN LIST A PROGRAM"
00970PRINT"CALLED 'CATLOG*' (NOTE THE DELIBERATE MISSPELLING) FOR AN"
00980PRINT"INVENTORY OF LIBRARY PROGRAMS, INFORMATIVE LISTINGS, AND MORE"
        00990PRINT"TUTORIAL MATERIALS."
01000PRINT"WE ALSO SOLICIT YOUR SUGGESTIONS ON HOW THIS PROGRAM"
01010 PRINT "OR ANY OF THE SERVICES OFFERED CAN BE IMPROVED. THE TS USER"
01020PRINT"TECHNOLOGIST ENJOYS A COMPUTER SUPPORT SYSTEM SECOND TO NONE"
01030PRINT"IN THE INDUSTRY, BUT IT IS ONLY THROUGH CONTINUAL IMPROVEMENT"
01040PRINT"THAT THIS LEADERSHIP CAN BE MAINTAINED..."
01050PRINT
01060PRINT"  ...AND ONLY THROUGH YOUR OWN AGGRESSIVE APPLICATION THAT IT"
01070PRINT"HAS ANY VALUE.   OUR MOST ENTHUSIASTIC WISHES FOR YOUR SUCCESS."
  01080PRINT"(WHEN READY FOR THE NEXT LESSON RUN 'TUTR03*'"
01090END