home *** CD-ROM | disk | FTP | other *** search
- 3000 'TUTR.03 Ver 2.0 01AUG83
- 3010 QUOTE$ = CHR$(34)
- 3020 PRINT CLS$;FNPOSCUR$(10,1);
- 3030 PRINT "Hi. Good to see you again. I'm assuming you have been through"
- 3040 PRINT "'TUTR01' and 'TUTR02'. You HAVE, haven't you? (yes or no)";
- 3050 INPUT A$
- 3060 CVTSTR$ = A$:GOSUB 40600:A$ = CVTSTR$
- 3070 PRINT
- 3080 IF LEFT$(A$,1) = "Y" THEN 3230
- 3090 IF LEFT$(A$,1) = "N" THEN 3120
- 3100 GOSUB 4310
- 3110 GOTO 3050
- 3120 PRINT "This may present some difficulties, since 'TUTR01' and 'TUTR02'"
- 3130 PRINT "should precede this lesson. Wouldn't you rather go back and try"
- 3140 PRINT "them first or should we continue (0 = go back, 1 = continue)";
- 3150 INPUT B
- 3160 CVTSTR$ = A$:GOSUB 40600:A$ = CVTSTR$
- 3170 PRINT
- 3180 IF B = 0 THEN 3210
- 3190 IF B = 1 THEN 3230
- 3200 GOTO 3150
- 3210 PRINT CLS$;FNPOSCUR$(10,1);"OK, then. I'm going to go back to the MENU"
- 3220 GOTO 4340
- 3230 PRINT CLS$;FNPOSCUR$(10,1);"Then let's review the example program used in 'TUTR01':"
- 3240 PRINT
- 3250 PRINT " 9 PRINT "QUOTE$"What are your values of X, Y, and Z?"QUOTE$";"
- 3260 PRINT " 10 INPUT X,Y,Z"
- 3270 PRINT " 20 LET R = SQR(X^2 + Y^2 + Z^2)"
- 3280 PRINT " 30 PRINT "QUOTE$"The radius vector equals"QUOTE$";R"
- 3290 PRINT " 35 GOTO 9"
- 3300 PRINT " 40 END"
- 3310 PRINT
- 3320 PRINT "This is now a complete program and shows you how to use some"
- 3330 PRINT "of the 'BASIC' language statements. By the way, did you get"
- 3340 PRINT "a chance to write a program of your own (yes or no)";
- 3350 INPUT C$
- 3360 CVTSTR$ = C$:GOSUB 40600:C$ = CVTSTR$
- 3370 PRINT
- 3380 IF LEFT$(C$,1) = "N" THEN 3420
- 3390 IF LEFT$(C$,1) = "Y" THEN 3470
- 3400 GOSUB 4330
- 3410 GOTO 3350
- 3420 PRINT CLS$;FNPOSCUR$(10,1);"That's too bad -- It helps you to learn if you"
- 3430 PRINT "practice with a problem that is familiar to you."
- 3440 PRINT "But, we'll get going here and you can try something on your"
- 3450 PRINT "own after this lesson."
- 3460 GOTO 3510
- 3470 PRINT CLS$;FNPOSCUR$(10,1);"That's great. I hope you were sucessfull in working out any"
- 3480 PRINT "problems that arose. Actually, practice in writing programs"
- 3490 PRINT "that solve some of your problems is the best way for you to"
- 3500 PRINT "get familiar with a computer and its language."
- 3510 PRINT
- 3520 PRINT "Now, let's take a look at some of the statements we've used."
- 3530 PRINT "For example, we used 'X', 'Y', and 'Z' as our known variables"
- 3540 PRINT "and 'R' as our unknown variable. In the 'LET' statement, the"
- 3550 PRINT "unknown (R) was 'SET EQUAL TO' the knowns in an expression."
- 3560 PRINT "Thus, we understand 'EQUATION' to mean:"
- 3570 PRINT
- 3580 PRINT " 'Do the computations on the right hand side of the ' = '"
- 3590 PRINT " sign and let the variable on the left represent the"
- 3600 PRINT " value after the computation is performed.'"
- 3610 GOSUB 4400
- 3620 PRINT "You can see that this is not an 'ALGEBRAIC' equation because"
- 3630 PRINT "we can type a statement like:"
- 3640 PRINT
- 3650 PRINT " 25 LET V = V + 1"
- 3660 PRINT
- 3670 PRINT "This statement simply means:"
- 3680 PRINT
- 3690 PRINT " Take the present value of 'V' and add 1 to it."
- 3700 GOSUB 4400
- 3710 PRINT "There are some things you should take note of:"
- 3720 PRINT
- 3730 PRINT " Variables may be of any length, starting with a letter, and"
- 3740 PRINT " may be mixed letters and numbers. There are certain words"
- 3750 PRINT " you may not use, though. These are called 'RESERVED' words."
- 3760 PRINT " You will find a list of RESERVED words in the MBASIC manual."
- 3770 PRINT " Now will be a good time to review these words."
- 3780 GOSUB 4400
- 3790 PRINT "Let's try a few examples and you tell me which ones are wrong."
- 3800 PRINT
- 3810 PRINT " (1) LET DIM = R*B^2"
- 3820 PRINT " (Type the number of"
- 3830 PRINT " (2) LET XY = A1 + B*3 the example and the"
- 3840 PRINT " carriage return key)"
- 3850 PRINT " (3) LET X9 = X^2 + Y^3"
- 3860 PRINT
- 3870 PRINT "Which one is wrong";
- 3880 INPUT C
- 3890 PRINT
- 3900 IF C = 1 THEN 3990
- 3910 IF C = 2 THEN 3950
- 3920 IF C = 3 THEN 3970
- 3930 PRINT "Try again and use 1, 2, or 3 for your answer. Which is wrong?";
- 3940 GOTO 3880
- 3950 PRINT "No, this is a valid statement - Try again. Which is wrong?";
- 3960 GOTO 3880
- 3970 PRINT "Not quite - this statement is legal. Try again; Which is wrong?";
- 3980 GOTO 3880
- 3990 PRINT CLS$;FNPOSCUR$(10,1);"Right! 'DIM' is a RESERVED word. Note, though, that RESERVED"
- 4000 PRINT "words can be imbedded in other words: 'DIMM' would be legal."
- 4010 PRINT
- 4020 PRINT " (1) LET X1 = X1 + Z^5"
- 4030 PRINT " (Type the number of"
- 4040 PRINT " (2) LET T2 = P + Q your choice and re-"
- 4050 PRINT " turn the carriage)"
- 4060 PRINT " (3) LET Y = DATA + 1"
- 4070 PRINT
- 4080 PRINT "Which one is wrong this time?";
- 4090 INPUT C
- 4100 PRINT
- 4110 IF C = 3 THEN 4200
- 4120 IF C = 2 THEN 4180
- 4130 IF C = 1 THEN 4160
- 4140 PRINT "Please -- Type the number 1, 2, or 3. Which ";
- 4150 GOTO 4090
- 4160 PRINT "No, this is valid - X1 would be incremented by 'Z^5'. Again....";
- 4170 GOTO 4090
- 4180 PRINT "This one is OK - Look a little closer. It should be....";
- 4190 GOTO 4090
- 4200 PRINT CLS$;FNPOSCUR$(10,1);"That's good. 'DATA' is illegal - You can't have a reserved word"
- 4210 PRINT "on either side of the equation."
- 4220 PRINT
- 4230 PRINT "So far the following kinds of statements have been used:"
- 4240 PRINT "' PRINT', 'INPUT', 'LET', 'GOTO', and 'END'. If you are at "
- 4250 PRINT "all uncertain as to how any of these are used, look once more"
- 4260 PRINT "at the previous sample problem. When you are positive you"
- 4270 PRINT "understand, switch to the program called 'TUTR04' to continue"
- 4280 PRINT "this lesson. I'll go back to the main menu and be ready to continue"
- 4290 PRINT "when you choose 'TUTR04'. "
- 4300 GOSUB 4400 ' return
- 4302 RUN "MENU
- 4310 PRINT "Not a valid choice. Try again. Which is it? ";
- 4330 RETURN
- 4400 'Here we print a message and wait abit
- 4410 PRINT FNPOSCUR$(24,1);"Hit any key to continue ... ";
- 4420 GOSUB 40800
- 4430 PRINT CLS$;FNPOSCUR$(10,1);
- 4440 RETURN
- POSCUR$(24,1);"Hit an