Question: Histogram java code Please follow all the conditions listed below To receive full credit, The constant called MAX must be declared atop the main (

Histogram java code
Please follow all the conditions listed below
To receive full credit,
The constant called MAX must be declared atop the main() method and effectively used in the program to generate random whole numbers from 0 to 9, inclusive. In general, avoid using 'magic numbers' in code because 'magic numbers' reduce code-readability. An integer constant/variable should not appear in the code except for possibly common integers, such as 0 or 1.
the main() method must call the following four programmer-defined methods (methods that you write):
an input non-void method that uses a Scanner object (declared in the main() method) but does not declare any variables within the method to return a Random object (that will be used to create random integers in a different method),
another input non-void method that uses a Scanner object (declared in the main() method) and a string-literal but does not declare any variables within the method to return an integer representing the number of items to store in the histogram,
a process non-void method that uses a Random object, and a constant (declared and instantiated in the main() method), and the integer that represents the number of items to store in the histogram and output an array (representing the histogram), and
an output void method that uses the array to display in ascending order (by index) its contents as a histogram: either an array of strings are simply printed or an array of single-digit integers must be displayed as a histogram.
the main() method should only contain:
the Scanner object instantiation and assignment,
a primitive constant (used to store the maximum whole number, exclusive, that can be generated by the RNG) declaration,
a primitive variable (used to store the number of items to store in the histogram) declaration,
the four method calls to the programmer-defined methods (the methods that you write), and
one method call to the Scanner object (that does not read from the input buffer!).
the input non-void method called by the main() method (to return a Random object) must call a different input non-void method that uses a Scanner object (declared in the main() method) and a String-object literal (representing a prompt for a seed) but does not declare any variables within the method to return an integer-primitive (that will be used to create the Random object in the calling method.
use the most appropriate loop, if necessary, to manage the array manipulation.
avoid using the 'break' command in loops (often in conjunction with the 'true' "continuation-condition") in order to avoid "spaghetti code". Instead, add a "volatile continuation-condition" (either a Boolean variable or a "relational equation" (an equation that utilizes a relational operator ('==','!=','>',"=', etc.)) that is subject to change based upon the value of a variable (which may be governed by user-defined input).
the only Scanner object must be declared in the main() method; do not move the Scanner object declaration nor declare another Scanner object in the program.
the program must contain multiple programmer-defined methods (the methods that you write), that complete the major steps of the program; each method should be focused on a singular task, and have a comment that gives a description of the method purpose.
every method should be preceded with a comment that includes a description of the method purpose and the value returned (if applicable)! Comments should also be included in the body of each method.
The program must properly function with any non-negative array size (including a size of 0).
The code should be written efficiently to
eliminate redundant coding and
eliminate variables used only once.
Use as few variables as possible.
Add a comment with your name, date, and program description at the top.
Histogram java code Please follow all the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!