New To Java - Help for Arrays
Hi everybody,
I got a problem and i will be happy if someone helps me with simple codes because i am a beginner.
I think my problem is easy to solve but i am not able to solve it by myself.
What i want is;
for example let
student[1]=1grademax[1] =60 grademin[1]=50
student[2]=2grademax[2] =70 grademin[2]=55
i want to use arrays and i want to enter the input like;
16050// (with seperates)(than press enter to go next line) ([1's])
27055//( [2's])
i wrote the code
for (i=0;i<=2;i++)
{
student<i>=input.nextInt();
grademax<i> =input.nextInt();
grademin<i>=input.nextInt();
}
than make some comparisons and print a result. for example ;
maxgrade = grademax[0] ;
mingrade = grademin[0] ;
for(sayac=1 ; sayac <= 2 ; sayac++)
{
if( grademax[sayac] > maxgrade )
maxgrade = grademax[sayac];
if( grademin[sayac] < mingrade )
mingrade = grademin[sayac];
}
But it only gives correct result if i enter the values in same line just like;1605027055
what do i need to add to loop to make it work when i enter student informations with different lines ?

