You are on page 1of 5

7.

9 StrokeViewController Class 1

Solution Manual for Java How to Program


Late Objects 10th Edition Deitel 0132575655
9780132575652
Full download link at:
Solution manual: https://testbankpack.com/p/solution-manual-for-java-
how-to-program-late-objects-10th-edition-deitel-0132575655-
9780132575652/

Test bank: https://testbankpack.com/p/test-bank-for-java-how-to-

program-late-objects-10th-edition-deitel-0132575655-

9780132575652/

Chapter 7
Doodlz App
7.1 Introduction
No questions

7.2 Test-Driving the Doodlz App


1. In the ARGB color scheme, for red, green and blue, 0.0 means none of that color
and 1.0 means ________.
a. the normal amount of that color
b. the complement of that color
c. the maximum amount of that color
d. the brightest version of that color
Ans: the maximum amount of that color
2 Chapter 7 Chapter 7 Doodlz App

7.3 Technologies Overview


7.3.1 Drawing with UIView Subclasses, Method drawRect,
UIBezierPaths and the UIKit Graphics System
1. In this app, you’ll use the UIKit graphics system’s higher-level, built-in drawing
capabilities, which all UIViews support via their ________ methods.
a. renderView
b. drawRect
c. renderScene
d. sketch
Ans: b. drawRect

2. The UIKit framework provides class ________ to represent shapes composed of


lines, arcs and curves.
a. UIShape
b. UIBezierPath
c. UIVectorGraphic
d. UIParametricPath
Ans: b. UIBezierPath

3. Drawing is performed using a graphics context that provides the current drawing
color and a rectangular region in which to draw—coordinates are measured from the
________ corner.
a. lower-right
b. lower-left
c. upper-right
d. upper-left
Ans: d. upper-left

7.3.2 Processing Multiple Touch Events


4. Which of the following statements about UIResponder methods is false?
a. You use method touchesMoved to track touches as the user moves fingers on the
screen.
b. You can use method touchesEnded to complete a UIBezierPath subclass that also
stores a line’s color when the user removes the corresponding finger from the screen.
c. You can use method touchesCancelled to remove in-progress Squiggles if iOS
cancels the touch events—for example, when the user receives a phone call.
d. As the user moves a given finger, that finger’s touch events will be maintained in
the same Touch object from the time that finger touches the screen to the time the user
removes it.
Ans: d. As the user moves a given finger, that finger’s touch events will be
maintained in the same Touch object from the time that finger touches the screen
7.9 StrokeViewController Class 3

to the time the user removes it. [Actually, "Touch object" should be "UITouch
object."]

7.3.4 Rendering the Drawing as a UIImage


5. iOS maintains graphics contexts in a ________.
a. list
b. tree
c. stack
d. queue
Ans: c. stack.

7.4 Building the App’s UI and Adding Its Custom


Classes
No questions

7.5 ViewController Class


7.5.2 Overridden UIViewController Method
prepareForSeque
1. UIViewController method ________ is called when the app is about to segue from
one view controller to another.
a. readyForSegue
b. planForSegue
c. prepareForSegue
d. arrangeForSegue
Ans: c. prepareForSegue

7.6 Squiggle Class


2. UIBezierPath method ________ uses the current drawing color to display the path
in the current graphics context.
a. display
b. draw
c. brush
d. stroke
Ans: d. stroke
4 Chapter 7 Chapter 7 Doodlz App

7.7 DoodleView Class


7.7.4 Overridden UIView Method drawRect
1. Custom drawing in a UIView is performed in method ________, which is called by
iOS whenever a view needs to be displayed or redisplayed.
a. drawView
b. drawCustom
c. drawScene
d. drawRect
Ans: d. drawRect

7.7.5 Overridden UIResponder Methods for Touch Handling


2. When one or more new touches begin, iOS calls method ________ and passes in an
NSSet containing UITouch objects representing each new touch point.
a. touchesMoved
b. touchesChanged
c. touchesEnded
d. touchesBegan
Ans: d. touchesBegan

3. When one or more touches end—that is, the user removes one or more fingers from
the screen—iOS calls method touchesEnded and passes in an ________ containing
UITouch objects representing the new touch points.
a. NSSet
b. NSArray
c. NSDictionary
d. NSList
Ans: a. NSSet

7.8 ColorViewController Class


7.8.2 Overridden UIViewController Method viewDidLoad
1. In Swift, when a variable is passed by reference, you must precede it with a(n)
________; otherwise, a compilation error occurs.
a. exclamation point (!)
b. at sign (@)
c. ampersand (&)
d. percent sign (%)
Ans: c. ampersand (&)
7.9 StrokeViewController Class 5

7.8.3 ColorViewController Methods colorChanged and


done
2. UIView property backgroundColor is an optional UIColor that’s nil by default
(indicating that a UIView is ________).
a. translucent
b. opaque
c. transparent
d. diaphanous
Ans: c. transparent

7.9 StrokeViewController Class


No questions

You might also like