So i posted several days ago about an adding grades to an array, which i managed to figure out. This is the code I currently have.
public class Grades {
public static void main (String[] args)
{
float result = 0;
Scanner scan = new Scanner(System.in);
int count = 0;
float[] grades = new float[100];
for (int i = 0; i < grades.length; i++) {
System.out.print("Enter a grade between 0.0 - 100.0 (enter -1 to quit): ");
grades[i] = scan.nextFloat();
if(grades[i] == -1)break;
result = result + grades[i];
count++;
}
System.out.println("Average of Grades: " + result / count);
System.out.println("Histogram Of Grades");
System.out.println("-------------------");
}
}
The problem I now have is that I need to add a * if the grades fall under that number range (ex.: 0-59: **, 60-69: ****) and so on for the grades up to 100. Im having trouble on how to know that the numbers fit then adding a star. Any help would be greatly appreciated, even just a start in the right direction.