Here - 1000 BiT
Here - 1000 BiT Here - 1000 BiT
RULE: You cannot do arithmetic with the numbers in strings.Correct:Wrong:Wrong:10 LET A = 3 + 710LETAS = 3 + 710 LET A = "3" + "7"If you run either of these wrong lines, the computer will print:TYPE MISMATCH ERROR IN 10There are two types of variables:number and string.You cannot put a number into a string box or a string into a number box.Enter10LETA=520LETB$="10"30 LET OA+BSLines 10 and 20 are OK, line 30 is wrong. What will the computer do when you run thislittle program?Try to guess what each of these statements will print, then enter the line to see whathappens:PRINT 5PRINT "5"PRINT "5+ 3"PRINT "5"+"3"PRINT5 + 3_62
MIXTURES IN PRINTYou can print numbers and strings in the same PRINT command. (Just remember thatyou cannot do arithmetic with the mixture.)Correct: PRINT A;"SEVEN ";"7"PRINT A;B$Run this line: 10 PRINT 5/2;"IS EQUAL TO 5/2"A FUNNY THING ABOUT THE EQUAL SIGNThe "=" sign in computing does not mean "equals" exactly. Look at this program:10LETN=N+1This does not make sense in arithmetic. Suppose N is 7. This would say that7=7+1which is not correct.But it is OK in computing to say N=N+1 because the "=" sign really means "replace."Here is what happens:Look at this:10 LET N=N+1The computer goes to the box with N written on the front.It takes the number 7 from the box.It adds 1 to the 7 to get 8.Then it puts the 8 into the box.63
- Page 13 and 14: n~ ABOUT PROGRAMMINGThere is a comm
- Page 15 and 16: nn INSTRUCTOR NOTES 1 NEW, PRINT, R
- Page 17 and 18: COMMAND THE COMPUTERTry this. Type
- Page 19 and 20: THE NUMBER ZERO AND THE LETTER "O"T
- Page 21 and 22: nINSTRUCTOR NOTES 2COLOR AND THE KE
- Page 23 and 24: There are eight colors on the numbe
- Page 25 and 26: OTHER COMMANDS IN PRINT STATEMENTSJ
- Page 27 and 28: LESSON 3 LIST, BOXES IN MEMORYClear
- Page 29: ADDING A LINEYou can add a new line
- Page 35 and 36: THE DELETE KEYThe DEL key is your "
- Page 37 and 38: INSTRUCTOR NOTES 5 TRICKS WITH PRIN
- Page 39 and 40: RULE: The semicolon makes the invis
- Page 41 and 42: Assignment 5:1- Write a program whi
- Page 43 and 44: LESSON 6THE INPUT COMMANDUse INPUT
- Page 45 and 46: YOU WEAR TWO HATS, USER AND PROGRAM
- Page 47 and 48: LESSON 7THE LET COMMAND, GLUING STR
- Page 49 and 50: GLUING THE STRINGSHere is how to st
- Page 51 and 52: LESSON 8THE GOTO COMMAND AND THE ST
- Page 53 and 54: A CAN OF SPAGHETTILook at this: 10
- Page 55 and 56: Assignment 8:1. Just for practice i
- Page 57 and 58: LESSON 9 THE IF COMMANDClear the me
- Page 59 and 60: JtTHE "NOT EQUAL" SIGNTwo signs:= m
- Page 61 and 62: INSTRUCTOR NOTES 10 INTRODUCING NUM
- Page 63: The thing which is put into the box
- Page 67 and 68: INSTRUCTOR NOTES 11TAB AND DELAY LO
- Page 69 and 70: HOW BIG A SPACE CAN TAB( ) MAKE?The
- Page 71 and 72: INSTRUCTOR NOTES 12 THE IF COMMAND
- Page 73 and 74: AN IF INSIDE AN IFThe "teenager" pr
- Page 75 and 76: 2. Here is another program. What wi
- Page 77 and 78: LESSON 13RANDOM NUMBERS AND THE INT
- Page 79 and 80: ROUNDING OFF NUMBERSPerhaps you kno
- Page 81 and 82: INSTRUCTOR NOTES 14SAVING TO TAPEWe
- Page 83 and 84: The computer automatically turned o
- Page 85 and 86: nnr^nnnnnr^nnLOADING A PROGRAM FROM
- Page 87 and 88: 5. We are ready to put in the next
- Page 89 and 90: n INSTRUCTOR NOTES 15 SOME SHORTCUT
- Page 91 and 92: AN INPUT SHORTCUTInstead of10 PRINT
- Page 93 and 94: WHEN TO USE THE COLON SHORTCUTUse t
- Page 95 and 96: But if we write this line in a prog
- Page 97 and 98: LESSON 16 MOVING PICTURESMOVING THE
- Page 99 and 100: Line 40 waits for you to see this b
- Page 101 and 102: LESSON 17FOR-NEXT LOOPSRemember the
- Page 103 and 104: LOOP VARIABLESTo make sure that eac
- Page 105 and 106: ^ INSTRUCTOR NOTES 18 DATA, READ, R
- Page 107 and 108: STRANGE RULES1. It doesn't matter w
- Page 109 and 110: MIXTURES OF DATAThe DATA statement
- Page 111 and 112: LESSON 19SOUND EFFECTSTurn up the s
- Page 113 and 114: TONES BY THE BUSHELEnter: 10 REM **
MIXTURES IN PRINTYou can print numbers and strings in the same PRINT command. (Just remember thatyou cannot do arithmetic with the mixture.)Correct: PRINT A;"SEVEN ";"7"PRINT A;B$Run this line: 10 PRINT 5/2;"IS EQUAL TO 5/2"A FUNNY THING ABOUT THE EQUAL SIGNThe "=" sign in computing does not mean "equals" exactly. Look at this program:10LETN=N+1This does not make sense in arithmetic. Suppose N is 7. This would say that7=7+1which is not correct.But it is OK in computing to say N=N+1 because the "=" sign really means "replace."<strong>Here</strong> is what happens:Look at this:10 LET N=N+1The computer goes to the box with N written on the front.It takes the number 7 from the box.It adds 1 to the 7 to get 8.Then it puts the 8 into the box.63