A one dimensional double type array named studentScores has
Solution
import java.util.Scanner;
public class MaxScore {
public static void main(String[] args) {
// TODO Auto-generated method stub
int N;
Scanner sc=new Scanner(System.in);
System.out.println(\"Enter N for no of students \");
N=sc.nextInt();
double studentScores[]=new double[N];
for(int i=0;i<N;i++)
{
System.out.println(\"Enter score for student \");//accept data from user
studentScores[i]=sc.nextDouble();
}
double max=-9999;
for(int i=0;i<N;i++)//loop to find max score
{
if(max<studentScores[i]) //if max is lessthan current element then update max
{
max=studentScores[i];
}
}
System.out.println(\"Maximum score is \"+max);//print result
}
}
==========================================
Enter N for no of students
3
Enter score for student
3
Enter score for student
4
Enter score for student
5
Maximum score is 5.0
