Here - 1000 BiT

Here - 1000 BiT Here - 1000 BiT

11.07.2015 Views

Another way to say the same thing is:10 LET N = ISI + 1means LET [new N) equal (old N) plus oneDON'T BE BACKWARD!In arithmetic, you can put the two numbers on which ever side of the equal sign youwant. But in the LET, you cannot.Arithmetic:3 = Nis the same asBASICLETN = 3LET 3 = NcorrectwrongBASICLET ISI = B is not the same asLET B * N Why not? (what is in each boxafter the line runs?)LET N = B means ,LET B = N means ,Assignment 10:1. Write a program which asks for your age and the current year. Then subtract andprint out the year of your birth. Be sure to use PRINT statements to tell what iswanted and what the final number means.2. Write a program which asks for two numbers and then prints out their product.(Multiplies them.) Be sure to use plenty of PRINTs to tell the user what is happening.64

INSTRUCTOR NOTES 11TAB AND DELAY LOOPSThe TAB command follows the familiar "tab" function of a typewriter. Delay loops slowthe program down so that its operation can be more easily observed. They also are usedfor portions of the program which must run at certain speeds, and should then be called"timing loops."TAB is used in a PRINT command and is designed to act exactly like the "tab" of atypewriter, including its faults. Several TAB commands can be used in one PRINTstatement, but the arguments in the ( ) must increase each time. That is, TAB cannotbe used to move the cursor back to the left.Use of a semicolon between TAB and the thing to be printed is not always necessary, butis recommended.The C-64 has a more general and powerful way of moving the cursor around. You simplyput CRSR arrows in quotes into a PRINT command. This will be illustrated in laterlessons.This lesson introduces loops in a painless way.The delay loop is all on one line, with a colon to separate off the NEXT command. Theamount of delay is determined by the size of the loop variable. A value of 1000 givesabout a one second delay.After seeing that the primary work of the loop is simply to count until a particular valueis reached before going on to the next instruction, it will be easier for the student tohandle loops in which things are going on inside.QUESTIONS:1. Show how to write a delay loop which lasts for about two seconds.2. Will this work for a delay loop?120 FOR Q=1000 TO 5000122 NEXT Q3. Tell what the computer will do in each case:10 PRINT "Hln;TAB(8];"GOOD LOOKING!"10TAB(5];PRINT"OH-OH!"10 PRINT TAB(10);"NOPE";TAB(1);"NOT HERE"4. What is the "argument" in this statement?20 PRINTTABfSJfE.T. CALL HOME"65

INSTRUCTOR NOTES 11TAB AND DELAY LOOPSThe TAB command follows the familiar "tab" function of a typewriter. Delay loops slowthe program down so that its operation can be more easily observed. They also are usedfor portions of the program which must run at certain speeds, and should then be called"timing loops."TAB is used in a PRINT command and is designed to act exactly like the "tab" of atypewriter, including its faults. Several TAB commands can be used in one PRINTstatement, but the arguments in the ( ) must increase each time. That is, TAB cannotbe used to move the cursor back to the left.Use of a semicolon between TAB and the thing to be printed is not always necessary, butis recommended.The C-64 has a more general and powerful way of moving the cursor around. You simplyput CRSR arrows in quotes into a PRINT command. This will be illustrated in laterlessons.This lesson introduces loops in a painless way.The delay loop is all on one line, with a colon to separate off the NEXT command. Theamount of delay is determined by the size of the loop variable. A value of <strong>1000</strong> givesabout a one second delay.After seeing that the primary work of the loop is simply to count until a particular valueis reached before going on to the next instruction, it will be easier for the student tohandle loops in which things are going on inside.QUESTIONS:1. Show how to write a delay loop which lasts for about two seconds.2. Will this work for a delay loop?120 FOR Q=<strong>1000</strong> TO 5000122 NEXT Q3. Tell what the computer will do in each case:10 PRINT "Hln;TAB(8];"GOOD LOOKING!"10TAB(5];PRINT"OH-OH!"10 PRINT TAB(10);"NOPE";TAB(1);"NOT HERE"4. What is the "argument" in this statement?20 PRINTTABfSJfE.T. CALL HOME"65

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!