Java Reference
In-Depth Information
PP 9.7 Design and implement an application that displays an animation
of a car (side view) moving across the screen from left to right.
Create a Car class that represents the car (or use one that was
created for a programming project in Chapter 8).
PP 9.8 Design and implement an application that displays an animation
of a horizontal line segment moving across the screen, eventually
passing across a vertical line. As the vertical line is passed, the
horizontal line should change color. The change of color should
occur while the horizontal line crosses the vertical one; therefore,
while crossing, the horizontal line will be two different colors.
PP 9.9 Design and implement an application that plays a game called
Catch-the-Creature. Use an image to represent the creature. Have
the creature appear at a random location for a random dura-
tion, then disappear and reappear somewhere else. The goal is
to “catch” the creature by pressing the mouse button while the
mouse pointer is on the creature image. Create a separate class to
represent the creature, and include in it a method that determines
if the location of the mouse click corresponds to the current loca-
tion of the creature. Display a count of the number of times the
creature is caught.
PP 9.10 Design and implement an application that works as a stopwatch.
Include a display that shows the time (in seconds) as it incre-
ments. Include buttons that allow the user to start and stop the
time, and reset the display to zero. Arrange the components to
present a nice interface. Hint : use the Timer class to control the
timing of the stopwatch.
PP 9.11 Design and implement a set of classes that define a series of
three-dimensional geometric shapes. For each, store fundamental
data about their size and provide methods to access and modify
this data. In addition, provide appropriate methods to compute
each shape's circumference, area, and volume. In your design,
consider how shapes are related and thus where inheritance can
be implemented. Create a main driver class to instantiate several
shapes of differing types and exercise the behavior you provided.
PP 9.12 Design and implement a set of classes that define various types
of electronics equipment (computers, cell phones, pagers, digital
cameras, etc.). Include data values that describe various attri-
butes of the electronics, such as the weight, cost, power usage,
and the names of the manufacturers. Include methods that are
VideoNote
Developing a solution
of PP 9.8.
Search WWH ::




Custom Search