had to write a program which is :
-------------------------------------------------------------------------------------
Write a java program that calls the following methods:
1. ReadStudentsData that takes as parameters an array NAMES ofString and another array SCORES of int. It should read an unspecified number of students’ scores and names. This method will return the number of students’ data read.
To stop entering data, the user must type a negative score. A valid score is a number between 0 and 100. Assume that the total number of students’ data is 10.
-------------------------------------------------------------------------------------
and i wrote the java program in grasp as:
-------------------------------------------------------------------------------------
import java.util.*;
import java.lang.*;
public class assignment3
{
static Scanner console=new Scanner (System.in);
public static void main (String[] args)
{ int assumed_data=10;
String[] NAMES=new String[assumed_data];
int[] SCORES=new int[assumed_data];
int count,aboveavg,belowavg;
double average;
count=ReadStudentsData(SCORES,NAMES);
System.out.println(count);
}
public static int ReadStudentsData(int[] SCORES,String[] NAMES)
{
int counter=0,i=0;
while((SCORES[i]<=100)&&(SCORES[i]>=0))
{
System.out.println("enter the name of the student = ");
NAMES[i]=console.nextLine();
System.out.println("enter the score of the student = ");
SCORES[i]=console.nextInt();
counter++;
i++;
}
return counter;
}
-------------------------------------------------------------------------------------
now my program is not evaluated correctly PLEASE HELP