take out a piece of paper and pen. the quiz starts one minute after the tardy bell rings. you will...

Download Take out a piece of paper and PEN. The quiz starts ONE minute after the tardy bell rings. You will have between 30 and 60 seconds per question. PreAP Computer

If you can't read please download the document

Upload: jamil-nash

Post on 14-Dec-2015

233 views

Category:

Documents


9 download

TRANSCRIPT

  • Slide 1

Take out a piece of paper and PEN. The quiz starts ONE minute after the tardy bell rings. You will have between 30 and 60 seconds per question. PreAP Computer Science Quiz 06.05-10 Slide 2 Title the quiz as shown below The quiz starts in ONE minute. Name Period Date Quiz 06.05-10 1.11. 2.12. 3.13. 4.14. 5.15. 6.16. 7.17. 8.18. 9.19. 10.20. EC. Slide 3 Question 01 Which method is used to output a string of characters on a graphics display? (a)displayString (b)drawString (c)graphicsString (d)showString (e)println Slide 4 Question 02 There are 36 colors built into the Expo class. Which Expo method lets you create new colors? (a) setColor (b) newColor (c) setRGB (d) createColor Slide 5 Question 03 Creating a new font requires what piece(s) of information (a)The name of the font (b)The style of the font (c)The size of the font (d)All of the above Slide 6 Question 04 Which of these commands will have its output affected by Expo.setFont? I.drawPixel II.drawLine III.drawCircle IV.drawString (a)I only (b)II only (c)III only (d)IV only (e)I, II and III only (f)I, II, III and IV Slide 7 Question 05 Which of these commands will have its output affected by Expo.setColor? I.drawPixel II.drawLine III.drawCircle IV.drawString (a)I only (b)II only (c)III only (d)IV only (e)I, II and III only (f)I, II, III and IV Slide 8 Question 06 Which of the following is NOT a valid font style? (a)Font.PLAIN (b)Font.BOLD (c)Font.UNDERLINE (d)Font.ITALIC (e)Font.BOLD + Font.ITALIC Slide 9 Question 07 Where are random numbers used outside your computer science course? (a) Advertising (b) Political polling (c) Video games (d) All of the above Slide 10 Question 08 Look at this display. Which command will create this exact shade of red ? (a) Expo.setColor(g,Expo.red); (b) Expo.setColor(g,1); (c) Expo.setColor(g,190,10,47); (d) Expo.setColor(g,232,216,94); (e)Expo.setColor(g,47,10,190); Slide 11 Assume the Qwerty font does not exist on your computer. What will be the result of this statement? Expo.setFont(g,Qwerty, Font.PLAIN, 12); (a)The program will not compile. (b)The program will compile, but not execute. (c)The program executes & substitutes the Arial Font. (d)The program executes & automatically downloads the Qwerty font so it will execute properly. Question 09 Slide 12 Which of these commands could create this shape on the graphics screen? (a)Expo.drawPolygon(g,100,300,200,100,300,300); (b)Expo.fillPolygon(g,100,300,200,100,300,300); (c)Expo.drawPolygon(g,100,300,150,100,250,100,300,300); (d)Expo.fillPolygon(g,100,300,150,100,250,100,300,300); Question 10 Slide 13 Which of these commands could create this shape on the graphics screen? (a)Expo.drawPolygon(g,100,300,200,100,300,300); (b)Expo.fillPolygon(g,100,300,200,100,300,300); (c)Expo.drawPolygon(g,100,300,150,100,250,100,300,300); (d)Expo.fillPolygon(g,100,300,150,100,250,100,300,300); Question 11 Slide 14 Question 12 Which statement displays a random number from 1 to 9? (a)System.out.println(Expo.random(0,9)); (b)System.out.println(Expo.random(1,10)); (c)System.out.println(Expo.random(1,9)); (d)System.out.println(Expo.random(9,1)); (e)System.out.println(Expo.random(0,10)); Slide 15 Question 13 Which statement can display any random 3-digit number? (a)System.out.println(Expo.random(100,999)); (b)System.out.println(Expo.random(101,998)); (c)System.out.println(Expo.random(99,1000)); (d)System.out.println(Expo.random(999,100)); (e)System.out.println(Expo.random(100,1000)); Slide 16 Question 14 Which of these does NOT properly simulate flipping a coin ? int x = Expo.random(0,1); if (x == 1) System.out.println(Heads); else System.out.println(Tails); int x = Expo.random(1,2); if (x == 1) System.out.println(Heads); else System.out.println(Tails); int x = Expo.random(1,3); if (x == 1) System.out.println(Heads); else System.out.println(Tails); int x = Expo.random(0,1); if (x == 1) System.out.println(Tails); else System.out.println(Heads); AC BD Slide 17 Question 15 This program segment will display 1000 random circles. Which of the following is NOT random in the output? (a)The location of each circle. (b)The color of each circle. (c)The size of each circle. for (int k = 1; k