Java Reference
In-Depth Information
EX 4.2 List some attributes and operations that might be defined for a
class called PictureFrame that represents a picture frame.
EX 4.3 List some attributes and operations that might be defined for a
class called Meeting that represents a business meeting.
EX 4.4 List some attributes and operations that might be defined for a
class called Course that represents a college course (not a par-
ticular offering of a course, just the course in general).
EX 4.5 Write a method called lyrics that prints the lyrics of a song
when invoked. The method should accept no parameters and
return no value.
EX 4.6 Write a method called cube that accepts one integer parameter
and returns that value raised to the third power.
EX 4.7 Write a method called random100 that returns a random integer
in the range of 1 to 100 (inclusive).
EX 4.8 Write a method called randomInRange that accepts two integer
parameters representing a range. The method should return a
random integer in the specified range (inclusive). Assume that the
first parameter is greater than the second.
EX 4.9 Write a method called randomColor that creates and returns a
Color object that represents a random color. Recall that a Color
object can be defined by three integer values between 0 and 255,
representing the contributions of red, green, and blue (its RGB
value).
EX 4.10 Draw a UML class diagram that shows the relationships among
the classes used in the Transactions program.
EX 4.11 Draw a UML class diagram that shows the relationships among
the classes used in the PushCounter program.
EX 4.12 Draw a UML class diagram that shows the relationships among
the classes used in the Fahrenheit program.
Programming Projects
Visit www.myprogramminglab.com to complete many of these
Programming Projects online and get instant feedback.
PP 4.1
Design and implement a class called Sphere that contains
instance data that represents the sphere's diameter. Define the
Sphere constructor to accept and initialize the diameter, and
include getter and setter methods for the diameter. Include
Search WWH ::




Custom Search