Quiz 7b

AMES 5

Quantitative Computer Skills

Quiz 7b, Feb. 18, 1999

(Closed book and notes, Choose one best answer, Use green scantron form)

1. Disk files provide a relatively permanent way to store information in a computer system. You must learn how to name and open text files from True BASIC programs, how to write information on files, and how to read information from files. If no files exist in your folder, the result of the program OPEN #1: name "ames5",create new (new line) END is

(a) an error message (b) an empty file (c) a file containing ames5 (d) null (e) a blank screen

2. The result of the program DIM day$(7) (new line) MAT INPUT day$ (new line) PRINT day$(3) (new line) END is

(a) an error message (b) the second item the user enters (c) the third item the user enters

(d) wednesday (e) tuesday

3. The result of the program CALL number (x) (new line) LET y=3 (new line) LET z=1 (new line) PRINT x;y;z (new line) LET y=1 (new line) LET x=5 (new line) END (new line) SUB number(y) (new line) LET z=3 (new line) LET x=5 (new line) LET y=1 (new line) LET z=0 (new line) END SUB is

(a) 1 3 1 (b) 0 0 0 (c) 5 3 1 (d) 5 1 3 (e) 7 6 4

4. The output of the program DIM day$(7) (new line) SET ZONEWIDTH 3 (new line) MATREAD day$ (new line) MAT PRINT day$ (new line) DATA su,mo,tu,we,th,fr,sa (new line) END is

(a) an error message (b) a blank screen (c) su mo tu we th fr sa (d) tuesday (e) saturday

5. The result of the program OPEN #1: name ames5,create new (new line) END is

(a) an error message (b) an empty file (c) a file containing ames5 (d) null (e) a blank screen

6. Arrays with two or more indices are called multidimensional arrays. The result of the program DIM name$(1 to 3,1 to 3) (new line) LET name$(3,1)="Mimi" (new line) PRINT name$(3,1) (new line) END is

(a) an error message (b) a blank screen (c) Irma (d) Mimi (e) $150

7. If the file ames5 exists, the result of the program OPEN #2: name "ames5",create old (new line) RESET #2: end (new line) PRINT #2: "last line" (new line) END is

(a) an error message (b) last line (c) new text at the end of the file

(d) first line (e) new text at the beginning of the file

8. The result of the program LET string$ = "abcdeabcdeabcde" (new line) PRINT ncpos(string$,"a",6) (new line) END is

(a) an error message (b) 6 (c) 7 (d) 8 (e) 5

9. The result of the program LET string$ = "abcdeabcdeabcde" (new line) PRINT ncposr(string$,"a",6) (new line) END is

(a) an error message (b) 6 (c) 7 (d) 8 (e) 5

 

Quiz 8 (takehome portion: due in section next week) PP2.4, PP2.5