Java Reference
In-Depth Information
EX 8.11 Describe a program for which you would use the ArrayList
class instead of arrays. Describe a program for which you would
use arrays instead of the ArrayList class. Explain your choices.
EX 8.12 What would happen if, in the Dots program, we did not pro-
vide empty definitions for one or more of the unused mouse
events?
EX 8.13 The Dots program listens for a mouse pressed event to draw a
dot. How would the program behave differently if it listened for
a mouse released event instead? A mouse clicked event?
EX 8.14 What would happen if the call to super .paintComponent were
removed from the paintComponent method of the DotsPanel
class? Remove it and run the program to test your answer.
EX 8.15 What would happen if the call to super .paintComponent
were removed from the paintComponent method of the
RubberLinesPanel class? Remove it and run the program to
test your answer. In what ways is the answer different from the
answer to Exercise 8.13?
EX 8.16 Create a UML class diagram for the Direction program.
Programming Projects
Visit www.myprogramminglab.com to complete many of these
Programming Projects online and get instant feedback.
PP 8.1
Design and implement an application that reads an arbitrary
number of integers that are in the range 0 to 50 inclusive and
counts how many occurrences of each are entered. After all input
has been processed, print all of the values (with the number of
occurrences) that were entered one or more times.
PP 8.2
Modify the program from PP 8.1 so that it works for numbers in
the range between −25 and 25.
PP 8.3
Design and implement an application that creates a histogram
that allows you to visually inspect the frequency distribution of
a set of values. The program should read in an arbitrary number
of integers that are in the range 1 to 100 inclusive; then produce
a chart similar to the one below that indicates how many input
values fell in the range 1 to 10, 11 to 20, and so on. Print one
asterisk for each value entered.
Search WWH ::




Custom Search