Example #1
0
        //------------------------------------

        private static Faculty ReadData()
        {
            Faculty allStudents = new Faculty(MaxStud);

            using (StreamReader reader = new StreamReader(@"Informatika.txt"))
            {
                string line = null;
                //line = reader.ReadLine();

                while (null != (line = reader.ReadLine()))
                {
                    string[] values        = line.Split(';');
                    string   surname       = values[0];
                    string   name          = values[1];
                    string   group         = values[2];
                    int      numberOfMarks = int.Parse(values[3]);
                    string[] value         = values[4].Split(' ');
                    int[]    marksArray    = new int[numberOfMarks];
                    //Console.WriteLine("{0}", name);
                    for (int i = 0; i < numberOfMarks; i++)
                    {
                        marksArray[i] = int.Parse(value[i]);
                        //Console.WriteLine(" {0} ", marksArray[i]);
                    }

                    OneStudent student = new OneStudent(name, surname, group, numberOfMarks, marksArray);
                    allStudents.AddData(student);
                }
            }
            return(allStudents);
        }
Example #2
0
 public void AddData(OneStudent students)
 {
     studentsArray[studentCount] = students;
     studentCount++;
 }
Example #3
0
 public Faculty(int count)
 {
     studentCount  = 0;
     studentsArray = new OneStudent[count];
 }