Quiz 9b

AMES 5

Quantitative Computer Skills

Quiz 9b, Mar. 4, 1999

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

1. True BASIC is case insensitive. The output of the program LET a$="M" (new line) IF a$="m" then PRINT "true" else PRINT "false" (new line) END is

(a) an error message (b) true (c) false (d) "true" (e) "false"

2. The output of the program LET a$="M" (new line) IF a$="m" then PRINT "true" else PRINT "false" (new line) END IF (new line) END is

(a) an error message (b) true (c) false (d) "true" (e) "false"

3. The result of the program ASK ZONEWIDTH WIDTH (new line) PRINT WIDTH (new line) END is

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

4. The output of the program LET x=2 (new line) LET y=3 (new line) LET z=4 (new line) LET w=z+y^(x+1) (new line) PRINT w (new line) END is

(a) an error message (b) 14 (c) 50 (d) 343 (e) 31

5. The output of the program LET x=2 (new line) LET y=3 (new line) LET z=4 (new line) LET w=z+y^x+1 (new line) PRINT w (new line) END is

(a) an error message (b) 14 (c) 50 (d) 343 (e) 31

6. The output of the program LET x=2 (new line) LET y=3 (new line) LET z=4 (new line) LET w=(z+y)^x+1 (new line) PRINT w (new line) END is

(a) an error message (b) 14 (c) 50 (d) 343 (e) 31

7. The output of the program LET x=2 (new line) LET y=3 (new line) LET z=4 (new line) LET w=(z+y)^(x+1) (new line) PRINT w (new line) END is

(a) an error message (b) 14 (c) 50 (d) 343 (e) 31

8. The output of the program LET a$="tinkywinky" (new line) PRINT len(a$); (new line) PRINT a$[6:len(a$)] (new line) END is

(a) an error message (b) 10 tinky (c) 10 winky (d) 10 tinkywinky (e) 9 tinky

9. The output of the program LET a$="tinkywinky" (new line) PRINT len(a$); (new line) PRINT a$[6:len(a$)] (new line) END is

(a) an error message (b) 10 tinky (c) 10 winky (d) 10 tinkywinky (e) 9 tinky

10. The output of the program LET a$="tinkywinky" (new line) PRINT len(a$)-1;a$[1:5] (new line) END is

(a) an error message (b) 10 tinky (c) 10 winky (d) 10 tinkywinky (e) 9 tinky

11. The output of the program LET a$="tinkywinky" (new line) PRINT posr(a$,"y"); a$[posr(a$,"t") : posr(a$,"y",9)] (new line) END is

(a) an error message (b) 10 tinky (c) 10 winky (d) 10 tinkywinky (e) 9 tinky

12. The output of the program DATA "2",2 (new line) READ a$,num (new line) LET sum = val(a$)+num (new line) PRINT sum (new line) END is

(a) an error message (b) 2 (c) "2" (d) 4 (e)"4"

13. The output of the program DATA "2",2 (new line) READ a$,rum (new line) LET sum = val(a$)+num (new line) PRINT sum (new line) END is

(a) an error message (b) 2 (c) "2" (d) 4 (e)"4"

14. The output of the program DATA "2",2 (new line) READ a$,num (new line) LET sum = val(a$)+num (new line) PRINT str$(sum) (new line) END is

(a) an error message (b) 2 (c) "2" (d) 4 (e)"4"

15. The output of the program DATA "2",2 (new line) READ a$,num (new line) LET sum = val(a$)+num (new line) PRINT chr$(34)&str$(sum)&chr$(34) (new line) END is

(a) an error message (b) 2 (c) "2" (d) 4 (e)"4"

16. The output of the program DATA "2",2 (new line) READ a$,rum (new line) LET sum = val(a$)+num (new line) PRINT chr$(34)&str$(sum)&chr$(34) (new line) END is

(a) an error message (b) 2 (c) "2" (d) 4 (e)"4"

17. The output of the program DATA "2",2 (new line) READ a$,rum (new line) LET x=val(a$) (new line) LET y=rum (new line) CALL add (x,y,z) (new line) PRINT z (new line) END (new line) SUB add (rum,sum,tinkywinky) (new line) LET tinkywinky=rum+sum (new line) END SUB is

(a) an error message (b) 2 (c) "2" (d) 4 (e)"4"

18. The output of the program DATA 1,1,1,1 (new line) DO while more data (new line) READ x (new line) LET sum=sum+x (new line) LOOP (new line) PRINT sum (new line) END is

(a) an error message (b) 2 (c) "2" (d) 4 (e)"4"

19. The output of the program DATA 1,1,1,1 (new line) FOR i=1 to 2 (new line) READ x (new line) LET sum=sum+x (new line) NEXT i (new line) PRINT sum (new line) END is

(a) an error message (b) 2 (c) "2" (d) 4 (e)"4"

20. The output of the program DATA "1","1","1","1" (new line) DO (new line) READ x$ (new line) LET sum=sum+val(x$) (new line) LOOP until end data (new line) PRINT sum (new line) END is

(a) an error message (b) 2 (c) "2" (d) 4 (e)"4"

Note: Versions of these questions and others from previous quizzes may be on the final quiz 10 (the stealth final exam). Good luck!