home *** CD-ROM | disk | FTP | other *** search
- 3000 REM TUT4
- 3010 QUOTE$ = CHR$(34)
- 3020 GOTO 3050
- 3030 PRINT "No such choice. Try again. Which";
- 3040 RETURN
- 3050 PRINT CLS$;FNPOSCUR$(10,1);"Hello again. Let's have a quick review. Using this code:"
- 3060 PRINT
- 3070 PRINT " 1 = PRINT ; 2 = INPUT ; 3 = LET; 4 = GOTO; 5 = END"
- 3080 PRINT
- 3090 PRINT "Which of the above is used for arithmetic operations";
- 3100 INPUT L
- 3110 PRINT
- 3120 IF L = 3 THEN 3160
- 3130 IF L < = 5 THEN 3180
- 3140 GOSUB 3030
- 3150 GOTO 3100
- 3160 PRINT "Very good. Which one (almost) always produces a question mark";
- 3170 GOTO 3200
- 3180 PRINT "Good try......But it isn't right. Once more....";
- 3190 GOTO 3100
- 3200 INPUT M
- 3210 PRINT
- 3220 IF M = 2 THEN 3280
- 3230 IF M < = 5 THEN 3260
- 3240 GOSUB 3030
- 3250 GOTO 3200
- 3260 PRINT "Take a 5-second break and try again. It should be...";
- 3270 GOTO 3200
- 3280 PRINT CLS$;FNPOSCUR$(4,1);"Excellent. If you use a comma with the INPUT statement, though,"
- 3290 PRINT "you can suppress the question mark. If your statement looks"
- 3300 PRINT "something like this:"
- 3310 PRINT : PRINT "10 INPUT ";QUOTE$;"Enter a value, please. ";QUOTE$",X"
- 3320 PRINT : PRINT "The screen will then show this:"
- 3330 PRINT : PRINT "Enter a value, please. "
- 3332 print : print "Note that there is no question mark."
- 3340 GOSUB 4480
- 3350 PRINT "Well, now, you seem to know them. Let us look at some"
- 3360 PRINT "other kinds of statements. We'll be using 'READ' and 'DATA',"
- 3370 PRINT "both of which must be used if either one is used."
- 3380 PRINT
- 3390 PRINT "Just judging from the sound of the word,"
- 3400 PRINT "'READ' sounds like it should resemble which one of these;"
- 3410 PRINT : PRINT " (USE 1 = LET, 2 = INPUT , 3 = GOTO, OR 4 = PRINT )"
- 3420 PRINT : PRINT FNCENTER$("");
- 3430 INPUT R
- 3440 PRINT
- 3450 IF R < = 4 THEN 3480
- 3460 GOSUB 3030
- 3470 GOTO 3430
- 3480 IF R = 2 THEN 3510
- 3490 PRINT "Wrong choice. Try again. Which one";
- 3500 GOTO 3430
- 3510 PRINT CLS$;FNPOSCUR$(4,1);"That's correct. In both cases, information is being put into"
- 3520 PRINT "the computer. The difference (note this) is WHEN it is to be"
- 3530 PRINT "entered. For the 'INPUT' statement, the computer receives"
- 3540 PRINT "information while the program is being executed; the "
- 3550 PRINT "terminal is used and it waits for the data entry. However,"
- 3560 PRINT "the 'READ' statement requires that the information (DATA)"
- 3570 PRINT "be already available in the computer's memory. Now you"
- 3580 PRINT "see where the 'DATA' statement comes in."
- 3590 GOSUB 4480
- 3600 PRINT "When the computer is instructed to 'READ', it immediately"
- 3610 PRINT "looks for the 'DATA' statement. The word 'READ' must be"
- 3620 PRINT "followed by the name or names of where the computer is to put the
- 3630 PRINT "'DATA' it is to 'READ'."
- 3640 PRINT "The actual numerical or letter values will be found after the word"
- 3650 PRINT "'DATA', so of course you must be sure that the values are there."
- 3660 GOSUB 4480
- 3670 PRINT "Now, let's return to our radius vector problem..."
- 3680 PRINT "First, let's delete lines 9 and 10. This is easily done by"
- 3690 PRINT "typing the line number followed by the return key. This would"
- 3700 PRINT "look as follows on the terminal:"
- 3710 PRINT : PRINT "9": PRINT "10": PRINT
- 3720 GOSUB 4480
- 3730 PRINT "Instead of using statements 9 and 10, let's say:"
- 3740 PRINT
- 3750 PRINT " 11 READ X, Y, Z"
- 3760 PRINT
- 3770 PRINT " 12 DATA 3, 4, 12"
- 3780 PRINT
- 3790 PRINT "Study the above two statements carefully. Notice where the"
- 3800 PRINT "COMMAS are (COMMAS are very important in computer directions."
- 3810 PRINT "You must never leave one out or put one in where it does not"
- 3820 PRINT "belong). What do you think the value of 'X' is";
- 3830 INPUT X
- 3840 PRINT
- 3850 IF X = 3 THEN 3940
- 3860 IF X = 4 THEN 3910
- 3870 IF X = 12 THEN 3910
- 3880 PRINT "No - You see, it has to be one of the numbers following the"
- 3890 PRINT "word 'DATA'. Try again, now. How much is X";
- 3900 GOTO 3830
- 3910 PRINT "That's a good try. You chose one of the numbers following"
- 3920 PRINT "'DATA', but not the right one. Once more: X = ";
- 3930 GOTO 3830
- 3940 PRINT "A perfect choice. And what is Z";
- 3950 INPUT Z
- 3960 PRINT
- 3970 IF Z = 12 THEN 4010
- 3980 PRINT "No, that's not correct. Study the statements again along with"
- 3990 PRINT "your previous answer concerning X and try again. Z = ";
- 4000 GOTO 3950
- 4010 PRINT "Right again, and you now have mastered the fundamentals of"
- 4020 PRINT "these two types of statements."
- 4030 GOSUB 4480
- 4040 PRINT "Let us consider one more thing about 'DATA' - You are allowed to"
- 4050 PRINT "have more than one data 'SET' with the 'DATA' statement. "
- 4060 PRINT "For instance, if we wanted to determine two radius vectors"
- 4070 PRINT "instead of one, we could replace statement 12 with:"
- 4080 PRINT
- 4090 PRINT " 12 DATA 3, 4, 12, 8, 15, 11"
- 4100 PRINT " "
- 4110 PRINT "This statement contains two X's, two Y's, and two Z's. One of"
- 4120 PRINT "each of these has been included in statement 12 above. Which"
- 4130 PRINT "do you think is the second Y: the '8', the '15', or the '11'";
- 4140 INPUT Y
- 4150 PRINT
- 4160 IF Y = 15 THEN 4240
- 4170 IF Y = 8 THEN 4210
- 4180 IF Y = 11 THEN 4210
- 4190 GOSUB 3030
- 4200 GOTO 4140
- 4210 PRINT "No; Take another look at the first set of data. Now, which"
- 4220 PRINT "one do you think it is";
- 4230 GOTO 4140
- 4240 PRINT CLS$;FNPOSCUR$(4,1);"That is correct. Also, the second X is 8 and the second Z"
- 4250 PRINT "is 11. So far, so good."
- 4260 PRINT
- 4270 PRINT "However, the computer won't automatically 'READ' both sets,"
- 4280 PRINT "unless it is somehow directed to use the 'READ' statement twice."
- 4290 PRINT
- 4300 PRINT "Use 1 = PRINT , 2 = GOTO, 3 = LET, and 4 = INPUT , and decide which of"
- 4310 PRINT "these could make it 'READ' more than one set of 'DATA'. Which";
- 4320 INPUT K
- 4330 PRINT
- 4340 IF K < = 4 THEN 4370
- 4350 GOSUB 3030
- 4360 GOTO 4320
- 4370 IF K = 2 THEN 4420
- 4380 PRINT "No, not that one. Again, which";
- 4390 GOTO 4320
- 4400 PRINT "That's not a permissible choice. Try again: which of"
- 4410 GOTO 4310
- 4420 PRINT CLS$;FNPOSCUR$(4,1);"You're doing fine. This ends the 'TUTR04' part of your"
- 4430 PRINT "lesson. Now call the program 'TUTR05' (use the same method"
- 4440 PRINT "you used to call 'TUTR04') and continue your study."
- 4450 PRINT "Good luck!"
- 4460 GOSUB 4480
- 4470 run "MENU"
- 4480 REM >> NON-STANDARD ROUTINES
- 4490 ' Here we give a message and wait for an input to continue
- 4500 PRINT FNPOSCUR$(24,1);TAB(20);"Hit any key to continue ... ";
- 4510 GOSUB 40800
- 4520 PRINT CLS$;FNPOSCUR$(4,1);
- 4530 RETURN