I have a text file contains a list of student and their grades. The format is: firstName + "\t" + lastName + "\t" + gpa;
Let's say if I want to make a selection to change 5th student's GPA, how can I code it?
Console.Write("Please select a student: ");
int selection;
String x= Console.ReadLine();
selection = Int32.Parse(x);
Console.Write("What is the new GPA: ");
string newGPA = Console.ReadLine();
I also made this one to read each student as the line number. Im not sure it's right or wrong.
System.IO.StreamReader file = new System.IO.StreamReader(@"D:\GPAs.txt");
while ((line = file.ReadLine()) != null)
{
//System.Console.WriteLine(line);
theGPA[counter] = line;
Console.WriteLine(theGPA[counter]);
counter++;
}