Quiz 9a
AMES 5
Quantitative Computer Skills
Quiz 9a, Mar. 2, 1999
(Closed book and notes, Choose one best answer, Use green scantron form)
1. Graphics mode computations assume a screen window. The following program determines the default window settings. The output of the program ASK WINDOW xmin,xmax,ymin,ymax (new line) PRINT xmin;xmax;ymin;ymax (new line) END is
(a) an error message (b) -1 1 -1 1 (c) 0 10 0 10 (d) 0 1 0 1 (e) 0 0 0 0
2. The output of the program SET WINDOW -1,1,-1,1 (new line) PRINT xmin;xmax;ymin;ymax
(new line) END is
(a) an error message (b) -1 1 -1 1 (c) 0 10 0 10 (d) 0 1 0 1 (e) 0 0 0 0
3. The output of the program SET WINDOW -1,1,-1,1 (new line) ASK WINDOW xmin,xmax,ymin,ymax (new line) PRINT xmin;xmax;ymin;ymax (new line) END is
(a) an error message (b) -1 1 -1 1 (c) 0 10 0 10 (d) 0 1 0 1 (e) 0 0 0 0
4. The output of the program OPEN #1:screen .2,.8,0.08,.92 (new line) SET WINDOW -1,1,-1,1 (new line) PLOT LINES:-.2,-.2;.2,-.2;.2,.2;-.2,.2;-.2,-.2 (new line) END is
(a) an error message (b) a centered rectangle (c) a loop (d) a blank screen (e) a centered square
5. The output of the program OPEN #1:screen .2,.8,0.08,.92 (new line) SET WINDOW -1,1,-1,1 (new line) PLOT LINES:-.2,-.2;.2,-.2;.2,.2;-.2,.2;-.2,-.2 (new line) SET COLOR "blue/yellow" (new line) FLOOD 0,0 (new line) END is
(a) an error message (b) a blue square on a yellow background (c) a yellow square on a blue background (d) a blank screen (e) a black screen
6. The output of the program OPEN #1:screen .2,.8,0.08,.92 (new line) SET WINDOW -1,1,-1,1 (new line) PLOT LINES:-.2,-.2;.2,-.2;.2,.2;-.2,.2;-.2,-.2 (new line) SET COLOR "yellow/blue" (new line) FLOOD 0,0 (new line) END is
(a) an error message (b) a blue square on a yellow background (c) a yellow square on a blue background (d) a blank screen (e) a black screen
7. The output of the program OPEN #1:screen .2,.8,0.08,.92 (new line) SET WINDOW -1,1,-1,1 (new line) DRAW square (.4,0,0) (new line) SET COLOR "yellow/blue" (new line) FLOOD 0,0 (new line) END (new line) PICTURE square (size,x,y) (new line) LET p=size/2 (new line) PLOT LINES:-p+x,p+y;p+x,p+y;p+x,-p+y;-p+x,-p+y;-p+x,p+y (new line) END PICTURE is
(a) an error message (b) a blue square on a yellow background (c) a yellow square on a blue background (d) a blank screen (e) a black screen
8. The output of the program OPEN #1:screen .2,.8,0.08,.92 (new line) OPTION ANGLE degrees (new line) SET WINDOW -1,1,-1,1 (new line) DRAW square (1,0,0) with rotate (30) (new line) END (new line) PICTURE square (r,x,y) (new line) LET p=r/2 (new line) PLOT LINES:-p+x,p+y;p+x,p+y;p+x,-p+y;-p+x,-p+y;-p+x,p+y (new line) SET COLOR "red/yellow" (new line) FLOOD x,y (new line) END PICTURE is
(a) a red square tilted left (b) a red square tilted right (c) a yellow square tilted left
(d) a red square (e) a yellow square tilted right
9. The output of the program PLOT lines:.2,.2;.4,.4;.1,.7 (new line) END is
(a) a triangle (b) two lines (c) three lines (d) three points (e) a black triangle
10. The output of the program PLOT lines:.2,.2;.4,.4;.1,.7;.2,.2 (new line) END is
(a) a triangle (b) two lines (c) three lines (d) three points (e) a black triangle
11. The output of the program PLOT area:.2,.2;.4,.4;.1,.7;.2,.2 (new line) END is
(a) a triangle (b) two lines (c) three lines (d) three points (e) a black triangle
12. The output of the program PLOT area:.2,.2;.4,.4;.1,.7 (new line) END is
(a) a triangle (b) two lines (c) three lines (d) three points (e) a black triangle
13. The output of the program PLOT points:.2,.2;.4,.4;.1,.7 (new line) END is
(a) a triangle (b) two lines (c) three lines (d) three points (e) a black triangle
14. The output of the program PLOT points:.2,.2;.4,.4;.1,.7;.2,.2 (new line) END is
(a) a triangle (b) two lines (c) three lines (d) three points (e) a black triangle
15. The output of the program DIM x(1,1) (new line) MAT READ x(3,2) (new line) MAT PLOT LINES:x (new line) DATA .2,.2,.4,.4,.1,.7 (new line) END is
(a) one line (b) two lines (c) three lines (d) three points (e) a black triangle
16. The output of the program DIM x(3,2) (new line) MAT READ x (new line) MAT PLOT LINES:x (new line) DATA .2,.2,.4,.4,.1,.7 (new line) END is
(a) one line (b) two lines (c) three lines (d) three points (e) a black triangle
17. The output of the program DIM x(1,1) (new line) MAT READ x(3,2) (new line) MAT PLOT AREA:x (new line) DATA .2,.2,.4,.4,.1,.7 (new line) END is
(a) one line (b) two lines (c) three lines (d) three points (e) a black triangle
18. The output of the program DIM x(1,1) (new line) MAT READ x(2,2) (new line) MAT PLOT LINES:x (new line) DATA .2,.2,.4,.4,.1,.7 (new line) END is
(a) one line (b) two lines (c) three lines (d) three points (e) a black triangle
19. The program DO (new line) GET MOUSE X,Y,S (new line) LOOP UNTIL S = 1 (new line) DO WHILE S = 1 (new line) GET MOUSE X,Y,S (new line) PLOT X,Y; (new line) LOOP (new line) PLOT x,y (new line) END produces a black line when the mouse is clicked that follows the position of the cursor as it moves until the button is released. To produce a red line, the last place for the statement SET COLOR "red" is after the statement beginning with
(a) GET MOUSE (b) PLOT X,Y (c) LOOP (d) PLOT x,y (e) END
20. The output of the program (new line) GET MOUSE x,y,s (new line) PRINT x;y;s (new line) END depends on the position of the cursor and the state of the mouse. If the cursor is centered on the screen and you hand is not on the mouse, the output is
(a) 0 0 0 (b) 0 0 1 (c) 0.5 0.5 1 (d) 0.5 0.5 0 (e) 0.5 0.5 2
Review problems for Quiz 10: PP3.3, PP3.10