Quiz
Chapter 5 and 6 Test
Erstelle ein kostenloses Konto, um dieses Quiz zu beenden
Speichere deinen Fortschritt und sieh dir dein Endergebnis an.
oder mit deiner E-Mail registrieren
Schon ein Konto? Anmelden
Fragen in diesem Quiz (68)
1In what language was Turtle Graphics originally introduced?
- APython
- BLogo
- CC++
- DASCII
2Why is it that we need to “import” commands from different libraries rather than simply making every command from every library available?
- AIt would take up too much space.
- BIt would take to little space.
- CIt has nothing to do with space at all.
3What is the purpose of the command: import turtle ?
- AGives access to the turtle library and its commands.
- BDoesn't give access to the turtle library and its commands.
4What is the purpose of the command: turtle.setup(800,600) ?
- ASpecifies dimensions of the Turtle Graphics window.
- BSpecifies nothing.
- CSpecifies everything but dimensions.
- DAll of the above.
5What is the purpose of the command: turtle.forward(100) ?
- AMakes the turtle move 1000 pixels forward.
- BMakes the turtle move 100 pixels forward.
- CDoesnt do anything.
6What is the purpose of the command: turtle.update ?
- ARequired to update the window when everything is drawn.
- BUpdates the window clearing everything.
- CUpdates the window but does not clear anything.
7What is the purpose of the command: turtle.done ?
- ARequired to keep the graphics window open when the program is finished.
- BRequired to keep the graphics window closed when the program is finished.
- CRequired to keep the graphics window not open when the program is finished.
- DRequired to keep the graphics window not open at all when the program is finished.
8What benefit do you get by using from with import?
- AThe benefit is that the program is less wordy.
- BThe benefit is that the program is more wordy.
- CThe benefit is that the program does not change at all.
- DThe benefit is that the program changes colors.
9What is an efficient way to draw a line that is 300 pixels long?
- AA more efficient way would be to do the command forward(300).
- BA more efficient way would be to do the command forward(100) three times.
- CA more efficient way would be to do the command forward(10) thirty times.
- DAll of the above.
10What 2 commands allow you to turn a specific number of degrees?
- Aright and left command
- Bup and down command
- Cno commands
- Deast and west command
11Can the turtle move backward?
- Ayes
- Bno
12Must all turns be 90-degree turns?
- Ayes
- Bno
13What does the width command do?
- AIncreases the width of a line.
- BIncreases the width of a shape.
- CIncreases the width of the output.
- DIncreases the width of a turtle.
14Suppose you have some code that draws an enclosed shape (like a square or triangle) in Turtle Graphics. How do you fill it in?
- Abegin_fill() and end_fill()
- Bbeginfill() and endfill()
- Cbegin_fill( and end_fill)
- Dbegin_fill and end_fill
15What command lets you add color to Turtle Graphics?
- AColor Command
- BSaturation Command
- CBlack and White Command
16What command clears the Turtle Graphics window?
- AThe command that clears the Turtle Graphic window is the clear command.
- BThe command that clears the Turtle Graphic window is the pause command.
- CThe command that clears the Turtle Graphic window is the color command.
17What command makes the computer pause for a certain number of seconds?
- AThe command that makes the computer pause for a certain number of seconds is the sleep command.
- BThe command that makes the computer pause for a certain number of seconds is the clear command.
- CThe command that makes the computer pause for a certain number of seconds is the pause command.
- DThe command that makes the computer pause for a certain number of seconds is the color command.
18From which library is the sleep command from?
- AGraphics Library
- BTime Library
- CPython Library
19What do reset and clear have in common?
- AThey both “clear” the window.
- BThey both do nothing to the window.
- CThey both “wipe” the window.
20Reset sets the Turtle Graphics Window to its original state and the clear just clears the window.
- ARichtig
- BFalsch
21Suppose you write a program that draws 2 different shapes in Turtle Graphics. Now you put a clear command between the 2 shapes. Does this affect the location or orientation of the second shape?
- ARichtig
- BFalsch
22What math library function will compute the absolute value of a number?
What math library function will return the greater of 2 numbers?
What math library function will return the lesser of 2 numbers?
What math library function performs the same calculation as the ** operator?- AThe abs function will compute the absolute value of a number.
The max function will return the greater of 2 numbers.
The min function will return the lesser of 2 numbers.
The pow function performs the same calculation as the ** operator. - BThe max function will return the greater of 2 numbers.
The min function will return the lesser of 2 numbers.
The pow function performs the same calculation as the ** operator. - CThe abs function will compute the absolute value of a number.
The max function will return the greater of 2 numbers. - DThe abs function will compute the absolute value of a number.
The max function will return the greater of 2 numbers.
The min function will return the lesser of 2 numbers.
- AThe abs function will compute the absolute value of a number.
23Arguments can be passed in 4 different formats. The 4 different formats are constant argument, variable argument, expression argument, and function argument.
- ARichtig
- BFalsch
24Are turtle and time the only libraries available in Python?
- ARichtig
- BFalsch
25In general, libraries contain several _subroutines__.
- ARichtig
- BFalsch
26A subroutine is a series of program commands that perform a specific task.
- ARichtig
- BFalsch
27If a subroutine is like a tool, then a library is like a __toolbox____.
- ARichtig
- BFalsch
28 The sqrt function will compute the square root of a number.
- ARichtig
- BFalsch
29“Functions return a value and procedures do not.”
- ARichtig
- BFalsch
30 The sqrt function works with integers and real numbers.
- ARichtig
- BFalsch
31An argument is the information that a function or procedure requires.
- ARichtig
- BFalsch
32List 5 trigonometric functions of the math library.
- Asin, cos, tan, log, and log10.
- Bsin, cos, tan, log, and log1.
- Csit, cos, tan, log, and log10.
- Dsin, con, tan, log, and log10.
33The 2 values that are stored in the math library are pi and e.
- ARichtig
- BFalsch
34In most programming languages, the graphics are _coordinate_________ based.
- ARichtig
- BFalsch
35List the differences between a Cartesian grid and a graphics window.
- AThe two differences are “The (0,0) coordinate is located in the top-left-hand corner of the graphics window instead of in the middle.” and the behavior of the Y coordinate values.
- BThere are no differences.
- CThe two differences are the X and Y coordinate.
36Is the Graphics library not a part of Python?
- ARichtig
- BFalsch
37What is the purpose of the beginGrfx procedure and its 2 arguments?
- AIt sets up the graphic windows and sizes it to our requested dimensions.
- BThe first two integers specify the starting coordinate. The 3rd and 4th integers specify the ending coordinate.
38A pixel is the tiniest possible dot that can be displayed on a computer screen.
- ARichtig
- BFalsch
39The arguments that are required by both drawPixel and drawPoint are integer arguments.
- ARichtig
- BFalsch
40What is the difference between drawPixel and drawPoint?
- AdrawPoint draws a 5x5 square instead of a pixel which makes it easier to see.
- BdrawPoint draws a pixel which makes it easier to see.
41What is the purpose of the endGrfx procedure?
- AendGrfx updates the screen and keeps it open until you are ready to close it.
- BendGrfx does not update the screen and keeps it open until you are ready to close it.
42Procedure drawLine has 4 integer arguments. In terms of drawing the line, what do they specify?
- AThe first two integers specify the starting coordinate. The 3rd and 4th integers specify the ending coordinate.
- BThe 3rd and 4th integers specify the starting coordinate. The first two integers specify the ending coordinate.
- CThey do not mean anything.
43drawLine and drawRectangle both have the same integer arguments. But in drawRectangle, there are 2 coordinate points, but they represent the upper-left-hand coordinate and the lower-right-hand coordinate of the rectangle.
- ARichtig
- BFalsch
44What happens to your graphics output if you make the logic error of switching your X and Y values?
- AThe graphic output will be diagonal.
- BThe graphic output will be sideways.
- CThe graphic output will be the same.
45The first 4 arguments of drawArc are identical to drawOval. drawArc has 2 additional arguments.
What do they specify?- AA stopping and starting degree.
- BOne color and the next color.
- CHow many degrees the Arc is in total and its starting degree.
46Procedure drawCircle has 3 integer arguments. In terms of drawing the circle, what do they specify?
- A[X ,Y] coordinate of the center, and the radius of the circle
- B[X ,Y] coordinate of the center, and the circumference of the circle
- C[X ,Y] coordinate of the center, and the diameter of the circle
- D[X ,Y] coordinate of the center, and the width of the circle
47When using drawOval, what will the output look like if the horizontal radius is greater than the vertical radius?
The output will be an oval that is short and fat.- ARichtig
- BFalsch
48When using drawOval, what will the output look like if the horizontal radius is less than the vertical radius?
The output will be an oval that is tall and thin.- ARichtig
- BFalsch
49When using drawOval, what will the output look like if the horizontal radius is equal to the vertical radius?
The output will be a circle.- ARichtig
- BFalsch
50What is an arc a piece of?
- Aoval
- Bcircle
- Csphere
- Dcircumference of a sphere
51Does the order of the arguments matter? Yes, the order of the arguments matter.
- ARichtig
- BFalsch
52If you did not have drawPolygon, you would need to use multiple __drawLine_________ commands instead.
- ARichtig
- BFalsch
53The book mentions that drawRegularPolygon has arguments similar to drawCircle. Why is this?
- Astart with the [X,Y] coordinate of the center
- Bradius
- Cenclosed shape
- Dindicates the number of sides
54drawRegularPolygon has 1 additional argument that drawCircle does not have. What is it used for?
- Aindicate the number of sides
- BA stopping and starting degree.
55What is the only difference in the arguments of drawStar, drawBurst and drawRegularPolygon?
In drawRegularPolygon the last argument indicates the number of sides.- ARichtig
- BFalsch
56For a fillLine procedure to work there has to be an enclosed shape. In drawLine the output is not an enclosed shape so there will not be a fillLine procedure.
- ARichtig
- BFalsch
57What happens when a small shape is drawn on top of a large shape that is the exact same color?
- AThe small shape will not be shown on top of the large shape.
- BThe small shape will be shown on top of the large shape.
58The default drawing color is black.
- ARichtig
- BFalsch
59What Graphics library procedure allows you to change the drawing color?
- AsetColor command
- BfillRegularPolygon command
- CfillArc command
60Python allows you to put 2 programming commands on one line, provided you do what?
- AAfter you type the first command put a semicolon and type the second command on the same line.
- BAfter you type the first command put a colon and type the second command on the same line.
- CAfter you type the first command put a comma and type the second command on the same line.
61What are the 2 rules for the number of int arguments in drawPolygon / fillPolygon?
- AThe number of integer arguments must be even and the input must have at least 6 integer arguments.
- BThe number of integer arguments must be odd and the input must have at least 6 integer arguments.
- CThe number of integer arguments must be odd and the input must have at least 9 integer arguments.
62What Graphics library procedure would you use to draw a stop sign?
- AfillRegularPolygon command
- BdrawRegularPolygon command
- CdrawArc command
63If you want to draw PAC-MAN, what procedure would you use?
- AfillArc command
- BfillOval command
- CsetColor command
64There are 8 different colors available in Python.
- ARichtig
- BFalsch
65Look at program mathLibrary03.py. Why does it have a syntax error?
- AIt has a syntax error because Fish is not a real number.
- BIt has a syntax error because the computer tries to compute the square root of a negative number causing the program to crash.
66Look at program mathLibrary04.py. Why does it have a run-time error?
- AIt has a run-time error because the computer tries to compute the square root of a negative number causing the program to crash.
- BIt has a run-time error because Fish is not a real number.
67Explain how program TurtleGraphics17.py fixes the issue of the previous program.
- AIt fixes the problem by using the penup() and pendown() commands.
- BIt drew the paths the turtle took to draw the four squares.
- CIt does not affect the location or orientation of the second shape.
68Look at program TurtleGraphics16.py. This program attempts to draw 4 separate squares, with one in each of the 4 corners of the window. Why is the output messed up?
- AIt drew the paths the turtle took to draw the four squares.
- BIt fixes the problem by using the penup() and pendown() commands.
- CIt does not affect the location or orientation of the second shape.
Informationen
- Beschreibung
- 9th grade Computer Science Quiz am Chapter 5 and 6 Test, erstellt von Lakshmi Aravindan am 14/10/2020.
- Autor
- Lakshmi Aravindan
- Sprache
- English
- Aufrufe
- 1
- Schlagwörter
- Bewertung
- Noch keine Bewertungen Bewerte dieses Quiz