Quiz 8a
AMES 5
Quantitative Computer Skills
Quiz 8a, Feb. 23, 1999
(Closed book and notes, Choose one best answer, Use green scantron form)
1. The final product of a computer program is a printed report in many applications, and appearance is important. Commas, semicolons and tab statements give limited control over the format of a complex report. A more powerful method is the PRINT USING format$: item1, item2, ... command. The numeric format characters are:
(a) #<> (b) #%*+-$^ (c) ~@#$%^& (d) @$^*)+ (e) #$%^&*(
2. The string format characters are:
(a) #<> (b) #%*+-$^ (c) ~@#$%^& (d) @$^*)+ (e) #$%^&*(
3. The result of the program PRINT using "####":-123.4567 (new line) END is
(a) -123.4567 (b) -123.45 (c) -123.5 (d) -123. (e) -123
4. The output of the program PRINT using "$$$$.##":123.4567 (new line) END is
(a) $123.4567 (b) 123.45 (c) $123.46 (d) ******** (e)$ 123.46
5. The output of the program PRINT using "$$$$$$.##":123.4567 (new line) END is
(a) $123.4567 (b) 123.45 (c) $123.46 (d)******** (e)$ 123.46
6. The output of the program PRINT using "$####.##":123.4567 (new line) END is
(a) $123.4567 (b) 123.46 (c) $123.46 (d) ******** (e)$ 123.46
7. The output of the program PRINT using "$##.##":123.4567 (new line) END is
(a) $123.4567 (b) 123.45 (c) $123.45 (d) ******** (e)$ 123.45
8. The output of the program PRINT using "$###.####":123.4567 (new line) END is
(a) $123.4567 (b) 123.45 (c) $123.45 (d) ******** (e)$ 123.45
9. The output of the program PRINT using "+++++.####":123.4567 (new line) END is
(a) + 123.4567 (b) 123.4567 (c) +123.4567 (d) ******** (e) + 123.4567
10. The output of the program PRINT using "++++.####":123.4567 (new line) END is
(a) + 123.4567 (b) 123.4567 (c) +123.4567 (d) ******** (e) + 123.4567
11. The output of the program PRINT using "----.####":-123.4567 (new line) END is
(a) - 123.4567 (b) - 123.4567 (c) 123.4567 (d) ******** (e) -123.4567
12. The output of the program PRINT using "-----.####":-123.4567 (new line) END is
(a) - 123.4567 (b) - 123.4567 (c) 123.4567 (d) ******** (e) -123.4567
13. The output of the program PRINT using "---.####":-123.4567 (new line) END is
(a) - 123.4567 (b) - 123.4567 (c) 123.4567 (d) ******** (e) -123.4567
14. The output of the program PRINT using "%%%%%%.####":-123.4567 (new line) END is
(a) -00123.4567 (b) -123.4567 (c) -0123.4567 (d) an error message (e) ********
15. The output of the program PRINT using "%%%%%#.####":-123.4567 (new line) END is
(a) -00123.4567 (b) -123.4567 (c) -0123.4567 (d) an error message (e) ********
16. The output of the program PRINT using "%%%.####":-123.4567 (new line) END is
(a) -00123.4567 (b) -123.4567 (c) -0123.4567 (d) an error message (e) ********
17. The output of the program PRINT using "###.##^^^":-123.4567 (new line) END is
(a) -1.235e+2 (b) -123.46e+0 (c) -12.35e+1 (d) ****** (e) -12.326e+1
18. The output of the program let a$="|####|" (new line) let b$="|<###|" (new line) let c$="|###>|" (new line) let d$="abc" (new line) PRINT using a$:d$; (new line) PRINT using b$:d$; (new line) PRINT using c$:d$; (new line) END is
(a) | abc || abc || abc | (b) | abc||abc || abc| (c) |abc || abc || abc| (d) |abc ||abc || abc| (e) |abc||abc||abc|
19. The output of the program let a$="|###|" (new line) let b$="|<##|" (new line) let c$="|##>|" (new line) let d$="abc" (new line) PRINT using a$:d$; (new line) PRINT using b$:d$; (new line) PRINT using c$:d$; (new line) END is
(a) |***||***||***| (b) | abc||***||***| (c) |***||abc ||abc| (d) |abc ||abc || abc| (e) |abc||abc||abc|
20. The output of the program SET COLOR "blue" (new line) SET WINDOW -1.4*5,1.4*5,-5,5 (new line) BOX LINES -1,1,-1,1 (new line) BOX CIRCLE 1,2,1,2 (new line) SET COLOR "red" (new line) FLOOD 1.5,1.5 (new line) SET COLOR "green" (new line) PLOT TEXT, AT -.5,0:"AMES 5" (new line) PLOT TEXT, AT -.5,-.5:"rules!" (new line) END is
(a) red square, blue circle, green message (b) blue square, red circle, green message (c) green square, blue circle, green message (d) green square, red circle, blue message (e) blue square, green circle, red message
21. The output of the program SET COLOR "green" (new line) SET WINDOW -1.4*5,1.4*5,-5,5 (new line) BOX LINES -1,1,-1,1 (new line) BOX CIRCLE 1,2,1,2 (new line) SET COLOR "red" (new line) FLOOD 1.5,1.5 (new line) SET COLOR "blue" (new line) PLOT TEXT, AT -.5,0:"AMES 5" (new line) PLOT TEXT, AT -.5,-.5:"rules!" (new line) END is
(a) red square, blue circle, green message (b) blue square, red circle, green message (c) green square, blue circle, green message (d) green square, red circle, blue message (e) blue square, green circle, red message
22. The result of the program LET string$ = "abcdeabcdeabcde" (new line) PRINT ncpos(string$,"bca",6) (new line) END is
(a) 5 (b) 6 (c) 7 (d) 8 (e) 9
23. The result of the program LET string$ = "abcdeabcdeabcde" (new line) PRINT ncposr(string$,"bca",6) (new line) END is
(a) 5 (b) 6 (c) 7 (d) 8 (e) 9
24. The result of the program DIM day$(7) (new line) MAT INPUT day$ (new line) PRINT day$(2) (new line) END is
(a) an error message (b) the second item the user enters (c) the third item the user enters
(d) monday (e) tuesday
25. The result of the program LET string$ = "Suez" (new line) CALL last (string$) (new line) PRINT string$ (new line) END (new line) SUB last (a$) (new line) LET a$=a$[len(a$)-2:len(a$)] (new line) END SUB is
(a) an error message (b) Sue (c) uez (d) ue (e) ez
Quiz 8 (takehome: due in section next
week) PP2.4, PP2.5,
PP3.7, PP3.9, PP3.12