• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java histogram program.. bit of help required please?  RSS feed

 
Chew Jool
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java histogram program.. bit of help required please?
hey guys im having trouble at moment with this program the aims is to generate random numbers 80 times between 1 and 100 and generate a histogram in category they fall in ie 1-10 and so on.. not only that i need for every number a single * should be entered into the histogram.. any hints or adivce would be great thankyou
 
fred rosenberger
lowercase baba
Bartender
Posts: 12565
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

A few tips on how to get the most out of our site:

1) don't post 80+ lines of code and say "Fix this up. Thanks!" I guarantee that over 99% of the folks who read a post like that will immediately move on to the next thread.

2) ask specific, directed questions. Where EXACTLY do you need help? Does the code you posted compile? Run? do 80% of what you need? What does it do right, what does it do wrong?

3) Please properly format your code. Code that is not indented is EXTREMELY hard to read, and those 1% who might attempt to read your code will probably stop once they realize it's not formatted right.

4) Make it as easy as possible for someone to help you. Everyone here has limited time to give. The less time they have to spend trying to figure out what help you may need, the more likely they are to be able to solve your problem.

 
Manu Ullas
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've made some changes to the code to display the histogram, replacing the switch statement with for loops. Compiling the program without changes causes an ArrayOutOfBoundsException.



Hope this helps.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!