Exemplo n.º 1
0
Arquivo: Program.cs Projeto: SWi98/UWr
        public static void WriteRegister(List <student> StudentList)
        {
            for (int i = 0; i < StudentList.Count(); i++)
            {
                string Name      = StudentList[i].Name;
                string Surname   = StudentList[i].Surname;
                string Birthdate = StudentList[i].BirthDate;
                string c1        = StudentList[i].address.City;
                string s1        = StudentList[i].address.Street;
                string c2        = StudentList[i].tempAddress.City;
                string s2        = StudentList[i].tempAddress.Street;
                Console.WriteLine("{0} {1}, Birthdate: {2}", Name, Surname, Birthdate);
                Console.WriteLine("Address: {0}, {1}; Temporary Address: {2}, {3}", c1, s1, c2, s2);
                Console.WriteLine("Classes:");
                WriteClasses(StudentList[i].classes.AllClasses);
                Console.Write("\n");
            }

            void WriteClasses(List <SingleClass> ClassList)
            {
                for (int i = 0; i < ClassList.Count(); i++)
                {
                    string Name  = ClassList[i].Name;
                    float  Grade = ClassList[i].Grade;
                    Console.WriteLine("{0}, Grade: {1}", Name, Grade);
                }
            }
        }