[ad_1]

So, 0, 10, 20, 30 are x-axis, and 0, 10000, 20000, 30000, 40000, 50000, 60000 are y-axis

import java.util.*;

import java.io.*;

/*

*

*

*

*

*

*

*

*

*

*

*

*

*/

public class PrintDistribution {

// private static String infile = “7_14_2019.txt”; The original data file name,

// included here for documentation.

public static int[] distribution = {0,1,8,59,215,703,1848,3975,8077,13937,22195,31628,

41711,51099,57142,59959,59670,55756,48850,40931,32583,

24995,18217,12794,8623,5577,3601,2272,1259,764,464,246,

153,80,39,22,12,6,3,0};

public static final int MAX_COUNTS = distribution.length;

public static void main(String[] args){

for (int i = 0; i < MAX_COUNTS ; i++) {

if (i % 10 == 0) {

System.out.print(i);

System.out.println(“|”);

}

else {

if (i < 10) {

System.out.println(” |”);

}

else {

System.out.println(” |”);

}

}

}

}

}

Sample Solution

The post Vertical histogram appeared first on acestar tutors.

[ad_2]

Source link