Java Reference
In-Depth Information
h. a - (b - c) - d
i. (a - (b - c)) - d
j. a - ((b - c) - d)
k. a % (b % c) * d * e
l. a + (b - c) * d - e
m. (a + b) * c + d * e
n. (a + b) * (c / d) % e
EX 2.12 Explain the role played by the Web in the translation and execu-
tion of some Java programs.
EX 2.13 Compare and contrast a traditional coordinate system and the
coordinate system used by Java graphical components.
EX 2.14 How many bits are needed to store a color picture that is 400
pixels wide and 250 pixels high? Assume color is represented
using the RGB technique described in this chapter and that no
special compression is done.
EX 2.15 Assuming you have a Graphics object called page , write a state-
ment that will draw a line from point (20, 30) to point (50, 60).
EX 2.16 Assuming you have a Graphics object called page , write a state-
ment that will draw a rectangle with height 70 and width 35,
such that its upper-left corner is at point (10, 15).
EX 2.17 Assuming you have a Graphics object called page , write a state-
ment that will draw a circle centered on point (50, 50) with a
radius of 20 pixels.
EX 2.18 The following lines of code draw the eyes of the snowman in the
Snowman applet. The eyes seem centered on the face when drawn,
but the first parameters of each call are not equally offset from
the midpoint. Explain.
page.fillOval (MID-10, TOP+10, 5, 5);
page.fillOval (MID+5, TOP+10, 5, 5);
Programming Projects
Visit www.myprogramminglab.com to complete many of these
Programming Projects online and get instant feedback.
PP 2.1
Create a revised version of the Lincoln application from Chapter
1 such that quotes appear around the quotation.
PP 2.2
Write an application that reads three integers and prints their
average.
Search WWH ::




Custom Search