Printing the Number of Times a Number in a Range Shows up
I'm reading 7 sales figures from a file (5000, 7000, 3000, 50, 100500, 75000, 300) and putting them into an array. I then calculate how much they should be paid (200 plus 9% of what they sold) and store that in a new array. My problem is getting the output to show how many salaries fall into a certain range.
Is what I have so far and the output I get is
public class Sales
public static void main(String args) throws Exception
Scanner input = new Scanner(new File("sale"));
int array = new int;
int frequency = new int;
double gross = new double;
int x = 0;
for(int i=0; i<array.length; i++)
for (int range=2; range<frequency.length; range++)
System.out.printf(" $%d+:", 1000);
However as I said I need a column under number to show how many of the 7 salaries will fall in that range. (The seven salaries being 650, 830, 470, 204.5, 9245, 695, 227) I know I need something in my second for loop following the if else to output the number of times it shows up but I can't figure it out. Thanks for any help.
Salary Range Number