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. Remember to test your program after every step.
ColorBlock) is a
ValidatedInputReaderclass that will allow you to prompt the user for the number of iterations to use for the simulation. One of the methods in this class is a static
getIntegermethod that takes five parameters: the initial prompt string, the minimum number that is valid, the maximum number that is valid, a suggested value, and the clarification prompt. Because the method is
static, it is tied to the class rather than to a specific object or instance of the class. In other words, you can call this method without constructing an instance of the class, as follows:
int numIterations = ValidatedInputReader.getInteger("prompt", min_val, max_val, suggested_val, "prompt2");
use the constant
Integer.MAX_VALUE to represent the
largest number that is acceptable. (You can read the full class
documentation for the
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
HistogramApp.javafile. Be sure that you have updated the class documentation at the top of the file and that your program conforms to the the documentation and style standards we have been using in this class. The class documentation comments should describe the purpose and behavior of your main class from a user's perspective. Also, update and submit the README document for the project. In both the class documentation and the README document, 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.