Results 1 to 3 of 3
Thread: Histrogram
- 11-10-2010, 02:18 PM #1
Senior Member
- Join Date
- Oct 2010
- Location
- Newark,nj
- Posts
- 111
- Rep Power
- 0
Histrogram
hey guys working on a histrogram , that shows frequency distribution of numbers entered from user.arrays are giving me trouble(particularly storing values inside of them).
HERES WHAT I HAVE SO FARJava Code:import java.util.Scanner; public class Histogram { public static void main(String[] args ) { int i = 0; int[] holder = new int[101]; Scanner scan = new Scanner(System.in); System.out.println("Please enter a couple of number"); int y = scan.nextInt(); while(y >=0) { System.out.println("Please enter a couple of number"); //holder[y]++; y = scan.nextInt(); } if(y <=10){ System.out.println("*****"); for(i = 0 ; i <holder.length; i++) { System.out.println(holder[i]); } // I WANT TO PRINT DIFF. # OF ASTER. FOR EACH VALUE I.E 1-10 (*****),11-20(**********), MAYBE AND SO ON } } }
- 11-10-2010, 02:23 PM #2
Did you have a question?
- 11-10-2010, 02:25 PM #3
Senior Member
- Join Date
- Oct 2010
- Location
- Newark,nj
- Posts
- 111
- Rep Power
- 0


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks