errors
I have 3 errors. this code inputs any test score u'd like and outputs the scores that are outstanding satifactory and unsatifactory my logic I believe is right but I'm getting 3 errors when I complie it lines 52 and 63 are illegal starts to expressions witch I believe they are right and line 109 wants a semi colon and its the end of my code so I dont understand why thats needed if anyone could help me fix my errors it be much help dont worry about the comments // so file compiles I wanna fix theses errors before I start making more.
import javax.swing.*;
/* Assignment 9
Author:
SC01
*/
public class Scores
{
private final static int SIZE = 25;
public static void main(String[] args)
{
int [] scores = new int[SIZE];
int count = 0;
double average = 0.0;
count = loadArray(scores);
average = determineAverage(scores, count);
displayResults(scores, count, average);
System.exit(0);
}
private static int loadArray(int[]n)
{
int count = 0;
int score = Integer.parseInt(JOptionPane.showInputDialog("Input text press Enter(-1 to end)"));
while(count < SIZE&& score != -1)
{
n[count] = score;
count++;
score = Integer.parseInt(JOptionPane.showInputDialog("Input text press Enter (-1 to end)"));
}
return count;
}
private static void displayResults(int[] n, int cnt, double ave);
{
int i;
for(i = 0; i < cnt; i++)
{
System.out.println();
}
System.out.printf("THE NUMBER OF OUTSTANDING SCORES %11d", determineOutstanding(n,cnt));
System.out.printf("THE NUMBER OF SATISFACTORY SCORES %11d", determineSatisfactory(n,cnt));
System.out.printf("THE NUMBER OF UNSATISFACTORY SCORES %11d", determineUnsatifactory(n,cnt));
private static int determineOutstanding(int[] n, int cnt);
{
int outstanding = 0;
int j;
for(j = 0; j < cnt; j++)
{
if(n[j] >= 90)
outstanding++;
}
return outstanding;
}
private static int determineSatisfactory(int[] n, int cnt)
{
int satisfactory = 0;
int i;
for(i = 0; i < cnt; i++)
{
if (n >= 60 && n < 90)
satisfactory++;
}
return satisfactory;
}
private static int determineUnsatifactory(int[] n, int cnt)
{
int unsatisfactory = 0;
int i;
for(i = 0; i < cnt; i++)
{
if (n < 60)
unsatisfactory++;
}
return unsatisfactory;
}
private static double determineAverage(int[] n, int cnt)
{
double Average = 0.0;
return Average;
}
private static int determineAboveAverage(int[] n, int cnt, double average)
{
return(0); // so file compiles
}
private static int determineBelowAverage(int[] n, int cnt, double average)
{
return(0); // so file compiles
}
private static int determineHighest(int[] n, int cnt)
{
return(0); // so file compiles
}
private static int determineLowest(int[] n, int cnt)
{
return(0); // so file compiles
}
}
}
Message was edited by:
thehurricane

