The contents of the arrays (student names and test scores) are pulled from a text file in this format:
Helen Mills
25
Jake Stein
35
etc.
I have used the following code to find the highest int in marks[]
and assign it to topMark
, however haven't been able to figure out how to store the corresponding name as strings for topFirstname
and topSurname
. So in this example I would like for int topMark = 35
, string topFirstname = Jake
and string topSurname = Stein
int topMark = marks[0];
foreach (int value in marks)
{
if (value > topMark) topMark = value;
}