CODE
private static int determineAboveAverage(int[] n, int cnt, double average) {
int count = 0;
for (int i = 0; i < cnt; i++)
if(n[i] > average)
count++;
return count;
}
System.out.printf("THE NUMBER OF SCORES ABOVE THE AVERAGE", determineAboveAverage(n,cnt));
CODE
private static int determineBelowAverage(int[] n, int cnt, double average) {
int count = 0;
for (int i = 0; i < cnt; i++)
if(n[i] < average)
count++;
return count;
}
System.out.printf("THE NUMBER OF SCORES BELOW THE AVERAGE", determineBelowAverage(n,cnt));
I made these to give me the Average below and a group of scores in a array but for some reason when I compile the code it says my println statement is incorrect I'm pretty sure my Above average code is right anyone can tell me if my below is right and how to fix my println statements
This post has been edited by rockstar4cs: 17 Apr, 2007 - 08:47 AM