Chapter 4 Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

TF

Using graphics.py allows graphics to be drawn into a Python shell window.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

TF

Traditionally, the upper-left corner of a graphics window has coordinates (0,0).

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

TF

A single point on a graphics screen is called a pixel.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q
TF
A function that creates a new instance of a class is called an accessor.
A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

TF

Instance variables are used to store data inside an object.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

TF

The statement myShape.move(10,20) moves myShape to the point (10,20).

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

TF

Aliasing occurs when two variables refer to the same object.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

TF

The copy method is provided to make a copy of a graphics object.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

TF

A graphics window always has the title “Graphics Window.”

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

TF

The method in the graphics library used to get a mouse click is readMouse.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

A method that returns the value of an object’s instance variable is called a(n)

A

accessories

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

A method that changes the state of an object is called a(n)

A

Mutator

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What graphics class would be best for drawing a square?

A

Rectangle

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What command would set the coordinates of win to go from (0,0) in the lower-left corner to (10,10) in the upper-right?

A

win.setcoords(0, 0, 10, 10)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What expression would create a line from (2,3) to (4,5)?

A

Line(Point(2,3), Point(4,5))

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What command would be used to draw the graphics object shape into the graphics window win?

A

shape.draw(win)

17
Q

Which of the following computes the horizontal distance between points p1 and p2?

A

abs(p1.getX() - p2.getX())

18
Q

What kind of object can be used to get text input in a graphics window?

A

Entry

19
Q

A user interface organized around visual elements and user actions is called a(n)

A

GUI

20
Q

What color is color_rgb(0,255,255)?

A

Cyan