NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
print out the asterisks and I dont know how to do that using the loop
Use the System.out.print() method in a loop. It will print its output on one line.
When you want to go to a new line use the println() method.
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
how to initialize them to zero
The default values for an int array is 0. You don't have to set it to 0.
how to check if they are in a range
Use conditional tests in an if statement.
if(a>b && c > d)
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
I am getting error messages
Please post the full text of the error messages you need help with.
Go read this again: http://docs.oracle.com/javase/tutorial/java/nutsandbolts/arrays.html
Where is the code that reads in and saves the input to be shown in the histograms?
I suggest that you do the project in steps:
1) read in and save the input in the array
2) print out the contents of the array using the Arrays class's toString() method to format the array for printing.
When the program does those two steps, look at how to print the array's contents in a histogram.
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
getting an uninitialized variable
Give the variable a value when you define it.
When you get an error message you should copy and paste here the full text. Just copying part of the message can leave off valuable information.
The code has many missing }s. The if statements at the end of the code all have {s without the matching }s
The code you've posted is trying to do too many things all at once. I suggest again that you do one thing at a time. When you get that one step done, then try adding the next step.
The first step should be getting the user's input into an array. And print it to see what is there.
When you can do that then add the next step.
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16