11.07.2015 Views

Here - 1000 BiT

Here - 1000 BiT

Here - 1000 BiT

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

INSTRUCTOR NOTES 10 INTRODUCING NUMBERSNumeric variables and operations are introduced. The LET, INPUT and PRINTcommands are revisited. The idea of memory as a shelf of "boxes" is extended tonumbers. Again, variable names are limited to one letter for the time being.The arithmetic operations are illustrated. The "*" symbol for multiplication will probablybe unfamiliar to the student. Division will give decimal numbers, so it is nice if yourstudent is familiar with them. But most arithmetic will be addition and subtraction, witha little multiplication, so a student unfamiliar with decimal numbers will not experienceany disadvantage.It may seem strange to the student that the numbers in string constants are not"numbers" which can be used directly in arithmetic. The VAL and STR$ functions will beintroduced later in the book and allow interconversion of numbers and strings.A mixture of string and numeric values can be printed by PRINT.The non-standard use of "=" in BASIC, that it means "replace" not "equal," shows upstrongly in the statement:LET N=N+1The cartoon uses the box idea to illustrate this meaning of "=".Another idea from arithmetic which does't work in a LET is shown below.Arithmetic: N = 3 means the same as 3 = NBASIC: LET N=3 is OK LET 3=N is notQUESTIONS:1. Name the three kinds of "boxes" in memory. (That is, named by the kinds of thingsstored in the boxes.)2. Explain why "N=N+1" for a computer is not like "5=5+1" in arithmetic.3. Give another example of "bad arithmetic" in a LET command. Use the * or / symbols.4. What does the computer mean by "TYPE MISMATCH ERROR"?5. Give an example of a program line which would have a TYPE MISMATCH ERROR.6. Explain what is meant by the "name of a variable" and the "value of a variable" fornumeric variables. For string variables.59

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

Saved successfully!

Ooh no, something went wrong!