Here - 1000 BiT
Here - 1000 BiT Here - 1000 BiT
Assignment 17B:1. Write a program which prints your name 15 times.2. Now make it indent each time by two spaces more. It will go diagonally down thescreen. Use TAB in a loop.3. Now make it write your name 23 times, starting at the bottom of the screen and goingup. Use the "up" keys in a PRINT and put it all into a loop.4. Now make it write your name on one line, your friend's name on the next and keepswitching until each name is written five times. Make each name a different color.5. Write a program with loops nested three deep. Do the outer loop three times and haveit print SING. Make it change the screen color each time through. The next loop printsTRA. Have it loop three times. The innermost loop prints LA three times.102
^ INSTRUCTOR NOTES 18 DATA, READ, RESTOREThis lesson concerns the DATA statement. READ gets data from the DATA statementsr*) and RESTORE puts the pointer back to the beginning of the first DATA statement.O The storing of data in DATA statements has a few confusing elements when firstconfronted. You can never change any of the data in the statement unless you rewrite the^ program. Of course, you can READ the data into a variable box, then change what's in^the box.^ You must READ the data to be able to use it. It must be read in order, starting from thebeginning. If you want to skip some data, you have to read and throw away the stuffr*\ before it. (This procedure is not discussed in the lesson, and may be mentioned to thestudent when other ideas about DATA are well entrenched.)^ The idea of a "pointer" is used in this lesson. A pencil in the hand of the instructor,nnpointing to items in a DATA statement, helps clarify this concept.Using DATA saves some error prone typing if you have a lot of data.However, it is also useful in cases where there is not really very much data because it^ clearly separates the actual data from the processing of the data. This helps when^debugging programs.r*) One of the most common uses of DATA is to fill arrays with initial values. We also use itin the MUSIC lesson to store note pitches and durations.^n^QUESTIONS:1. What happens if you try to READ more data items than are in the DATA statements?2. What rule tells you where to put the DATA statements in the program? How aboutwhere to put the READ statements?3. The idea of a "pointer" helps in thinking about the DATA statements. Explain how.n4. Can you put numeric data and string data into the same DATA statement?■■5. What happens if you try to READ a string into a numeric variable?r^ 6. Can you change the items in a DATA statement while the program runs?nnnn ...n 103
- 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 and 64: The thing which is put into the box
- Page 65 and 66: MIXTURES IN PRINTYou can print numb
- 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: LOOP VARIABLESTo make sure that eac
- 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 **
- Page 115 and 116: "TM" stands for "timbre." Timbre is
- Page 117 and 118: INSTRUCTOR NOTES 20NAMES, CLOCKS AN
- Page 119 and 120: cAnytimeyou type, the characters ar
- Page 121 and 122: LESSON 21COLOR GRAPHICSADJUST YOUR
- Page 123 and 124: Add these lines to the above progra
- Page 125 and 126: INSTRUCTOR NOTES 22POKEing GRAPHICS
- Page 127 and 128: Try this: Change the number 83 to a
- Page 129 and 130: We can number the streets and house
- Page 131 and 132: n INSTRUCTOR NOTES 23 SECRET WRITIN
- Page 133 and 134: THE COMPUTER ISIMPATIENTThe compute
- Page 135 and 136: ^ INSTRUCTOR NOTES 24 PRETTY PROGRA
- Page 137 and 138: Assignment 24A:1. The delay loop is
- Page 139 and 140: Assignment 24B:1. Write a short pro
- Page 141 and 142: LESSON 25 LOGIC: AND, OR, NOTANOTHE
- Page 143 and 144: THE IF COMMAND TELLS LITTLE WHITE L
- Page 145 and 146: THE LOGIC SIGNSYou can use these si
- Page 147 and 148: LESSON 26 SNIPPING STRINGS: LEFTS,
- Page 149 and 150: CUTTING A PIECE OUT OF THE MIDDLETh
- Page 151 and 152: nnO INSTRUCTOR NOTES 27 SWITCHING N
- Page 153 and 154: MAKING NUMBERS INTO STRINGSRun10 RE
^ INSTRUCTOR NOTES 18 DATA, READ, RESTOREThis lesson concerns the DATA statement. READ gets data from the DATA statementsr*) and RESTORE puts the pointer back to the beginning of the first DATA statement.O The storing of data in DATA statements has a few confusing elements when firstconfronted. You can never change any of the data in the statement unless you rewrite the^ program. Of course, you can READ the data into a variable box, then change what's in^the box.^ You must READ the data to be able to use it. It must be read in order, starting from thebeginning. If you want to skip some data, you have to read and throw away the stuffr*\ before it. (This procedure is not discussed in the lesson, and may be mentioned to thestudent when other ideas about DATA are well entrenched.)^ The idea of a "pointer" is used in this lesson. A pencil in the hand of the instructor,nnpointing to items in a DATA statement, helps clarify this concept.Using DATA saves some error prone typing if you have a lot of data.However, it is also useful in cases where there is not really very much data because it^ clearly separates the actual data from the processing of the data. This helps when^debugging programs.r*) One of the most common uses of DATA is to fill arrays with initial values. We also use itin the MUSIC lesson to store note pitches and durations.^n^QUESTIONS:1. What happens if you try to READ more data items than are in the DATA statements?2. What rule tells you where to put the DATA statements in the program? How aboutwhere to put the READ statements?3. The idea of a "pointer" helps in thinking about the DATA statements. Explain how.n4. Can you put numeric data and string data into the same DATA statement?■■5. What happens if you try to READ a string into a numeric variable?r^ 6. Can you change the items in a DATA statement while the program runs?nnnn ...n 103