Quiz # 2

AMES 5

Quantitative Computer Skills

Quiz 2, January 14, 1999

(closed book&notes, Scantron form #20788-ERI: Write Section, StudentID, CodeWord)

1. True BASIC uses labeled mailboxes (memory locations) called variables to store information that can be accessed from a program. Two types of variables are identified; those that store numbers (numerical variables) and those that store characters (string variables). A numerical variable could be named:

(a) num$(b) num (c) 1num (d) the num (e) Num$.

2. The information stored in a memory location is the value of the variable. The value of the variable Num might be:

(a) "8" (b) 8 (c) eight (d) EIGHT (e) 8$. 3. A numerical variable has two components, a real part and an imaginary part: (a) true (b) false. 4. Assigning a new value to a variable destroys the old value: (a) true (b) false. 5. The assignment or LET statement is used to assign a value to a variable. The program LET cost$ = 29 (next line) Let tax = 0.06 * cost$(next line) PRINT tax (next line) END will result in: (a) 29 (b) 1.74 (c) hello (d) an error message (e) disaster. 6. The symbol used by True Basic for exponentiation is: (a) * (b) ** (c) *** (d) ^ (e) exp. 7. The symbol used by True Basic for multiplication is: (a) x(b) ** (c) \times (d) * (e) X. 8. The symbol used by True Basic for division is: (a) \div (b) ./. (c) / (d) \/ (e) div. 9. The order of precedence for arithmetic operators is from left to right, first exponentiation, then multiplication and division, then addition and subtraction. Expressions within parentheses are always evaluated first. The value of LET X = 2*5 + (9/3)^2 - 7 is: (a) 1.e1 (b) 12 (c) 25 (d) twenty-five (e) twelve. 10. If the string variable Trip$ has the value "travel in the country", the substring Trip[5:6]\$ has the value:

(a) ra (b) av (c) rt (d) el (e) nt.

11. The result of the program ASK ZONEWIDTH WIDTH (new line) PRINT WIDTH (new line) END is likely to be:

(a) 2 (b) 4 (c) 6 (d) 16 (e) 80.

12. The result of the program PRINT using "###.##": -133.33 (new line) END is:

(a) -133.33 (b) -1.3e2 (c) ****** (d) an error message (e) 0.

The magic number is 0572630