I have a question about the third for loop, how does it work please ?
public void outputBarChart()
{
System.out.println("Grade Distribution: \n");
int frequency[] = new int[11];
for(int oneGrade : grade)
{
++frequency[oneGrade / 10];
}
for (int count = 0; count < frequency.length; count++)
{
if (count == 10) {
System.out.println("100");
}
else {
System.out.printf("%02d-%02d: ",
count*10, count*10 + 9);
}
//the third for loop here !
for (int star = 0; star < frequency[count]; star++){
System.out.print("*");
}
System.out.println();
}
}
The problem is I don't know the mechanics how it print out stars.