Quiz # 3a

AMES 5

Quantitative Computer Skills

Quiz 3a, January 19, 1999

(Closed book and notes, Choose one best answer)

1. If the string variable is assigned a value by LET person\$ = "Warren T. Wonka 486905555", where the numbers and spaces represent Warren's Zip Code, then you can extract his Zip Code by the command LET zip\$ =

(a) person\$[zip] (b) person\$[zipcode\$] (c) person\$[17:100] (e) person\${17:25}.

2. The response of INPUT name\$ (new line) END (run) is a question mark (?). If the user enters a RETURN, the reponse is

(a) thank you! (b) Too few input items. Please add more. (c) sets name\$ to null (d) 0 (e) "".

3. The response of INPUT name\$ (new line) END (run) is a question mark (?). If the user enters War,Peace the reponse is

(a) wrong! (b) Too few input items. Please add more. (c) sets name\$ to War (d) War (e) Peace.

4. The response of LINE INPUT prompt "": name\$ (new line) END (run) is a blank screen. If the user enters War,Peace the reponse is

(a) next item? (b) Too many input items. Excess ignored. (c) sets name\$ to War,Peace.

5. The program OPEN #1: name "test.file", create newold (new line) ERASE #1 (new line) PRINT #1: "the first line of test.file" (new line) END produces

(a) a file with one line (b) a blank file (c) #1 on the screen (d) an error message (e) disaster.

6. If the file test.file exists and has three lines in sequence, the program OPEN #1: name "test.file" (next line) RESET #1: begin (new line) LINE INPUT #1: line3\$ (next line) PRINT line3\$ (next line) END will print

(a) an error message (b) the third line (c) the first line (d) the second line (e) nothing.

7. Computer programs become more powerful and useful when they are capable of making decisions (branching) and repeating actions (looping).

(a) true (b) false

8. The output of the program on the right is

(a) an error message (b) 20 (c)23 (d) 26 (e) 0

LET sum = 20

DO while more data

LET sum = sum + num

LOOP

DATA 1,2,3

PRINT sum

END

9. The first line read by True Basic in the program of question 8. is

(a) END (b) DATA (c) LET (d) LOOP (e) READ