Trailing-Edge
-
PDP-10 Archives
-
decuslib10-01
-
43,50141/tutr11.bas
There are 2 other files named tutr11.bas in the archive. Click here to see a list.
00001REM TUT11
00100PRINT"WITH THIS PROGRAM YOU HAVE AN OPPORTUNITY TO PRACTICE ON: (1) A"
00110PRINT"'TRIG' FUNCTION, (2) A 'LOG' FUNCTION, OR (3) OTHER STANDARD"
00120PRINT"FUNCTIONS. TYPE NUMBER OF CHOICE: WHICH DO YOU WANT TO DO";
00130INPUTC
00140PRINT
00150IFC=1THEN210
00160IFC=2THEN920
00170IFC=3THEN5000
00180IFC=10652THEN530
00185IFC=27429THEN1300
00190PRINT"YOU AREN'T PLAYING FAIR. BETTER YOU START OVER: TYPE 'RUN'."
00200STOP
00210PRINT"HERE WE GO. PICK ONE OF THE TRIGONOMETRIC FUNCTIONS: SINE,"
00220PRINT"COSINE, OR TANGENT. IN THE SPACE BELOW, WRITE A PROGRAM WHICH"
00230PRINT"WILL GIVE THE FOLLOWING OUTPUT:"
00240PRINT
00250PRINT" 'THE VALUE OF THE (FILL IN FUNCTION NAME) FOR (FILL"
00260PRINT" IN ANGLE VALUE) DEGREES IS (FILL IN FUNCTION VALUE)'"
00270PRINT
00280PRINT"DO IT FOR 8 SEQUENTIAL ANGLE VALUES. WRITE YOUR PROGRAM HERE:"
00290FORI=1TO20
00300PRINT
00310NEXTI
00320PRINT"WHEN YOU'RE DONE, TYPE '1' AND WE'LL CONTINUE -"
00330PRINT
00340PRINT" ARE"
00350PRINT
00360PRINT" YOU"
00370PRINT
00380PRINT" DONE"
00390PRINT
00400PRINT" YET"
00410PRINT
00420PRINT" ";
00430INPUTJ
00440PRINT
00450IFJ=1THEN480
00460PRINT"OK - KEEP WORKING ON IT. DONE YET";
00470GOTO430
00480PRINT"NOW TYPE 'NEW', GIVE YOUR PROGRAM A NAME, ENTER IT WHEN I TYPE"
00490PRINT"AN '*', AND TRY RUNNING IT. WHEN YOU'RE DONE, TYPE 'OLD' AND"
00500PRINT"WHEN I'M READY, TYPE 'TUTR11*' AGAIN. ONLY THIS TIME BE VERY"
00510PRINT"SURE YOU TYPE 10652 IN ANSWER TO MY FIRST QUESTION."
00520STOP
00530PRINT"AND YOU'VE WRITTEN A PROGRAM! GOOD. NOW FOR THE 63.95 QUESTION:"
00540PRINT"(1=YES, OTHER NUMBERS=NO) DID IT WORK...?";
00550INPUTW
00560PRINT
00570IFW<>1THEN600
00580PRINT"THIS MAKES YOU A TRIGONOMETRICT. SO CALL IN 'TUTR12*', OR"
00585PRINT "IF YOU'VE BEEN THROUGH THAT ONE CALL IN 'TUTR13*'. OK."
00590STOP
00600PRINT"WELL HERE'S ONE THAT WILL. TYPE THE NUMBER OF THE CHOICE HERE:"
00610PRINT"DID YOU USE (1) SINE, (2) COSINE, OR (3) TANGENT";
00620INPUTP
00630PRINT
00640IFP=1THEN680
00650IFP=2THEN680
00660IFP=3THEN680
00670GOTO610
00680PRINT"AND WHAT ANGLE DID YOU START WITH? HOW MANY DEGREES";
00690INPUTN
00700PRINT
00710PRINT"HOW ABOUT THE INCREMENT? NUMBER OF DEGREES";
00720INPUTM
00730PRINT
00740PRINT"O.K. - HERE YOU ARE - CALL THE ANGLE 'A':"
00750PRINT
00760PRINT" 100 FOR A = ";N;"TO ";N+M*7;"STEP ";M
00770IFP=3THEN860
00780IFP=2THEN890
00790PRINT" 110 PRINT ''THE VALUE OF THE SINE OF'';"
00800PRINT" 120 PRINT A;''DEGREES IS'';SIN(A*3.14159/180)"
00810PRINT" 130 NEXT A"
00820PRINT" 140 END"
00830PRINT
00840PRINT"TRY IT OUT; YOU SHOULD BE SUCCESSFUL. THEN CALL IN 'TUTR12*',"
00845PRINT"OR IF YOU'VE BEEN THROUGH THAT ONE CALL IN 'TUTR13*'. OK?"
00850STOP
00860PRINT" 110 PRINT ''THE VALUE OF THE TANGENT OF'';"
00870PRINT" 120 PRINT A;''DEGREES IS'';TAN(A*3.14159/180)"
00880GOTO810
00890PRINT" 110 PRINT ''THE VALUE OF THE COSINE OF'';"
00900PRINT" 120 PRINT A;''DEGREES IS'';COS(A*3.14159/180)"
00910GOTO810
00920PRINT"THE FOLLOWING PROGRAM WILL PRINT OUT A TABLE OF COMMON 'LOGS'"
00930PRINT"FROM LOG(2.0) THROUGH LOG(8.8) IN INCREMENTS OF 0.2; HOWEVER"
00940PRINT"IT IS IN THE WRONG ORDER, EXCEPT FOR THE FIRST STATEMENT:"
00950PRINT
00960PRINT" 100 DIM J(10) (THIS ONE SHOULD BE FIRST)"
00970PRINT
00980PRINT" 200 LET N(J)=LOG(I+J/10)/LOG(10)"
00990PRINT
01000PRINT" 300 NEXT I"
01010PRINT
01020PRINT" 400 PRINT"
01030PRINT
01040PRINT" 500 FOR I=2 TO 8"
01050PRINT
01060PRINT" 600 END"
01070PRINT
01080PRINT" 700 PRINT '' '';I;N(0);N(2);N(4);N(6);N(8)"
01090PRINT" (2 SPACES BETWEEN QUOTATION MARK PAIRS)"
01100PRINT" 800 FOR J=0 TO 8 STEP 2"
01110PRINT
01120PRINT" 900 NEXT J"
01130PRINT
01140PRINT" 1000 PRINT ''NUMBER (A) .0 (B) .2 (B) .4 (B) .6 (B) .8''"
01150PRINT" ('A'=5 SPACES, 'B'=6 SPACES)"
01160PRINT" NOW WHEN I STOP, YOU DO THE FOLLOWING:"
01170PRINT
01180PRINT" REARRANGE THE PROGRAM IN PROPER SEQUENCE"
01190PRINT
01200PRINT" TYPE 'NEW'; WAIT FOR 'PROGRAM NAME?'"
01210PRINT
01220PRINT" TYPE A NAME FOR YOUR PROGRAM; WAIT FOR AN '*' TO PRINT."
01230PRINT
01240PRINT" TYPE OUT THE PROGRAM; THEN TYPE 'RUN'"
01250PRINT
01260PRINT" WHEN RUN IS COMPLETED, CALL IN 'TUTR11*' AGAIN"
01270PRINT
01280PRINT" ANSWER MY FIRST QUESTION BY TYPING 27429"
01290STOP
01300PRINT"DID THE PROGRAM RUN PROPERLY (0=NO, OTHER NUMBERS=YES) ";
01310INPUTZ
01320IFZ=0THEN1360
01330PRINT"THEN I GUESS YOU'RE A LOGARITHMIAN - PROCEED WITH YOUR LESSON"
01340PRINT"BY CALLING IN 'TUTR12*' (IF YOU'RE THROUGH WITH THAT ONE"
01345PRINT"CALL IN 'TUTR13*' ) FROM THE LIBRARY. YOU'RE DOING FINE."
01350STOP
01360PRINT"WELL, HERE'S A SEQUENCE THAT WILL WORK FOR YOU:"
01370PRINT
01380FORA=200TO900STEP100
01390READB
01400PRINT" CHANGE ";A;" TO ";B
01410NEXTA
01420PRINT" CHANGE 1000 TO 110"
01430DATA150,180,120,130,190,170,140,160,110
01440PRINT
01450PRINT"TRY IT-AND WATCH IT WORK. THEN CALL IN 'TUTR12*'(OR IF"
01455PRINT"YOU'VE BEEN THROUGH THAT CALL 'TUTR13*') FROM THE LIBRARY"
01470STOP
05000PRINT"TRY THIS ONE: WHAT IS ABS(SQR(15-6*INT(1.8742)))";
05010INPUTE
05020PRINT
05030IFE=3THEN5100
05040PRINT"NO; INT(1.8742)=1 (INTEGER PART), SO 6*INT(1.8742)-6*1, OR 6."
05050PRINT"THEN SQR(15-6) IS +3 OR -3, AND ABS(+3) OR ABS(-3) ARE BOTH 3."
05100PRINT"HOW ABOUT: INT(5-ABS(SQR(1.84+ABS(1-X)))) WHEN X=4";
05110INPUTG
05130IFG=2THEN5200
05140PRINT"CAN'T BE. NOTICE: ABS(1-X)=ABS(-3) WHICH IS +3, AND SQR(1.84+3)"
05150PRINT"IS +2.2 OR -2.2. NOW ABS(+2.2) AND ABS(-2.2) ARE BOTH 2.2, AND"
05160PRINT"INT(5-2.2), OR INT(2.8), IS 2 (INTEGER PART ONLY) - THE ANSWER."
05170 GO TO 5220
05200 IF E<>3 THEN 5220
05210PRINT"YOU HAD THEM BOTH RIGHT, SO I'LL PRONOUNCE YOU A FUNCTIONEER."
05220PRINT"LET'S GO ON WITH OUR LESSON. CALL IN 'TUTR12*',OR IF YOU'VE"
05230PRINT"COMPLETED THAT ONE CALL IN 'TUTR13*'."
05240END