This part of the programming project may be done individually or in groups of two. Keep in mind that you may not work with the same person on more than two of the programming projects. If you work with a teammate, hand in one copy of your code with both names on it. It is okay to get help from the TAs and/or the instructor if you get stuck, but you should try to do it on your own first.
The purpose of this assignment is to enhance the Histogram program from the Histogram Lab.
| Final Location | Index | |
|---|---|---|
DisplayableTable constructor
to make the call to the constructor more readable.
ValidatedInputReader Class from the Aquarium
Lab Series to prompt the user for the number of iterations to
use for the simulation. To do this select Import from the File
menu, click on File System and Next. Then click on Browse and
find the directory
that contains the class ValidatedInputReader,
select it and click on Choose. The class can be found in the
BlackBoxCode subdirectory of the Aquarium Lab Series Code
directory. Click on the Directory name in
the left panel and then check the ValidatedInputReader
class in the right panel. Then click on the Finish button.
This will bring the ValidatedInputReader
class into your Histogram project.
This class has a second static method
getInteger that takes as its parameters the initial
prompt string, the minimum number that is valid, the maximum
number that is valid, a suggested value,
and the clarification prompt. You may
use the constant Integer.MAX_VALUE to represent the
largest number that is acceptable. Once you have prompted the
user for the number of iterations, change your program so that it
uses this number to control the number of iterations that the
simulation runs. Then remove the
NUM_ITERATION constant. Test it with different
numbers of iterations, including zero and one or more negative
numbers.
HistogramLab.java file to turn in. Be sure that you have updated
the class documentation at the top of the file and that your program conforms
to the CS Program Style Guide and Documentation
Standards for this class. The class documentation comments should describe
the purpose and behavior of your main class from a user's perspective. Focus
on what the program does, rather than how it does it. Include
your name and the date as well as the names of anyone from whom you received
help. Following the style and documentation standards is an important step
towards writing well-structured and reusable programs. The Program
Style Guide also describes the program grading scale used in this course.
As usual, whenever you place files in the Temp folder, it
is your responsibility under the Kalamazoo College honor code to remove
them.