Ejemplo n.º 1
0
 static void Main(string[] args)
 {
     Student st1 = new Student();
     st1.ShowName();
     Student.ShowAcademy();
     Console.WriteLine("Оценка: {0}", st1.GetMark());
 }
Ejemplo n.º 2
0
        static void Main()
        {
            Student[] listOfStudents = new Student[]
            {
                new Student("Petar", "Petrov", 21),
                new Student("Stamat", "Doichinov", 22),
                new Student("Gosho", "Todorov", 17),
                new Student("Ivan", "Zahariev", 30),
                new Student("Zahari", "Ivanov", 12),
                new Student("Albena", "Albenova", 23),
                new Student("Albena", "Ivanova", 31),
                new Student("Ivan", "Albenov", 18)
            };

            var resultLambda = listOfStudents
                .OrderByDescending(st => st.FirstName)
                .ThenByDescending(st => st.LastName);

            var resultLINQ =
                from st in listOfStudents
                orderby st.FirstName descending,
                st.LastName descending
                select st;

            Console.WriteLine("Lambda: ");
            Student.Information(resultLambda);
            Console.WriteLine("LINQ");
            Student.Information(resultLINQ);
        }
Ejemplo n.º 3
0
 static void Main()
 {
     Student a = new Student("AAA", "BBB", "CCC", 322, "aaaa bbb", "12345678", "*****@*****.**",
         "courseAAAA", SpecialtyEnum.aaaSp, UniversityEnum.aaUn, FacultyEnum.cccFac);
     Student b = new Student("ZZZ", "BBB", "CCC", 321, "aaaa bbb", "12345678", "*****@*****.**",
         "courseAAAA", SpecialtyEnum.aaaSp, UniversityEnum.aaUn, FacultyEnum.cccFac);
     Student c = new Student("AAA", "BBB", "CCC", 321, "aaaa bbb", "12345678", "*****@*****.**",
         "courseAAAA", SpecialtyEnum.aaaSp, UniversityEnum.aaUn, FacultyEnum.cccFac);
     Console.WriteLine(a.ToString());
     Console.WriteLine();
     Console.WriteLine(b.ToString());
     Console.WriteLine();
     Console.WriteLine(c.ToString());
     Console.WriteLine("student a is student b:{0}",a.Equals(b));
     Console.WriteLine("student a is student c:{0}", a.Equals(c));
     Console.WriteLine("student a is student c:{0}", a==c);
     Console.WriteLine("student a is not student c:{0}", a != c);
     Console.WriteLine("student a is not student b:{0}", a != b);
     Console.WriteLine("Student not overriden hash code:{0} {1} {2}",a.FirstName.GetHashCode(),a.MiddleName.GetHashCode(),a.LastName.GetHashCode());
     Console.WriteLine("Student a overriden hash code:{0}",a.GetHashCode());
     var d = a.Clone();
     Console.WriteLine();
     Console.WriteLine("Cloned student a:");
     Console.WriteLine(d.ToString());
     var students = new Student[] { c, b, a }.OrderBy(x => x).ToArray();
     foreach (var st in students)
     {
         Console.WriteLine(st.FirstName +" " + st.MiddleName+" "+st.LastName+" "+st.SSN);
     }
 }
        public static bool IsOlderThan(this Student student, Student otherStudent)
        {
            var firstStudentDate = ParseStudentDate(student.OtherInfo);
            var secondStudentDate = ParseStudentDate(otherStudent.OtherInfo);

            return firstStudentDate > secondStudentDate;
        }
Ejemplo n.º 5
0
 public static Student create(string name, string surname, int gpa)
 {
     Student st = new Student(name, surname, gpa);
     store[k] = st;
     k++;
     return st; 
 }
Ejemplo n.º 6
0
        /// <summary>
        /// A method that tests the methods in <see cref="Student"/> class.
        /// </summary>
        public static void Main()
        {
            Student peter = new Student("Peter", "Ivanov", "Sofia", new DateTime(1992, 3, 17));
            Student stella = new Student("Stela", "Markova", "Vidin", new DateTime(1993, 3, 11), "gamer,high results");

            Console.WriteLine("{0} is older than {1} -> {2}", peter.FirstName, stella.FirstName, peter.IsOlderThan(stella));
        }
Ejemplo n.º 7
0
 // Prints some student
 private static void PrintStudent(string text, Student student)
 {
     Console.ForegroundColor = ConsoleColor.White;
     Console.WriteLine(text);
     Console.ResetColor();
     Console.WriteLine(student);
 }
Ejemplo n.º 8
0
        static void Main()
        {
            JuniorTrainer fil   = new JuniorTrainer("Filip", "Kolev", 22);
            SeniorTrainer nasko = new SeniorTrainer("Nasko", "Rusenov", 18);

            fil.CraateCourse("C# Advanced");
            nasko.CraateCourse("OOP");

            Student.Student[] students = new Student.Student[]
            {
                new GraduateStudent("Petya", "Petrova", 29, 12003, 5.90),
                new CurrentStudent("Ivan", "Adamov", 24, 71432, 3.54, "OOP"),
                new DropoutStudent("Ivan", "Angelov", 33, 12003, 2.54, "Week results."),
                new CurrentStudent("Georgi", "Popov", 22, 71433, 4.14, "OOP"),
                new DropoutStudent("Angel", "Georgiev", 32, 12006, 4.40, "Discipline problems."),
                new CurrentStudent("Stamat", "Strahilov", 32, 71412, 5.52, "Java Basics"),
                new CurrentStudent("Goran", "Ivanov", 19, 71434, 3.54, "PHP"),
                new CurrentStudent("Ivana", "Lyubenova", 44, 71439, 3.00, "OOP"),
                new OnlineStudent("Zdaravko", "Zdravchev", 22, 12032, 4.80, "OOP"),
                new OnsiteStudent("Lyuba", "Staykova", 45, 32001, 3.55, "JavaScript"),
            };

            Student.Student[] studentsQuery = students
                                              .Where(student => student is CurrentStudent)
                                              .OrderBy(student => student.AverageGrade)
                                              .ToArray();

            Console.WriteLine();
            foreach (Student.Student student in studentsQuery)
            {
                Console.WriteLine(student);
            }
        }
Ejemplo n.º 9
0
 static void Main()
 {
     Student student = new Student("Peter", 22);
     student.PropertyChanged += (sender, eventArgs) => Console.WriteLine("Property changed: {0} (from {1} to {2})",
         eventArgs.Property, eventArgs.OldValue, eventArgs.NewValue);
     student.Name = "Maria";
     student.Age = 19;
 }
Ejemplo n.º 10
0
        static void Main(string[] args)
        {
            Student student = new Student("Pesho", 20);
            student.ChangeEvent += (string str) => Console.WriteLine(str);

            student.Age = 22;
            student.Name = "Kiro";
        }
Ejemplo n.º 11
0
 static void Main(string[] args)
 {
     string name = Console.ReadLine();
     string surname = Console.ReadLine();
     double gpa =Convert.ToDouble(Console.ReadLine());
     Student info = new Student(name, surname, gpa);
     Console.WriteLine(info);
     Console.ReadKey();
 }
Ejemplo n.º 12
0
 public static void Main(string[] args)
 {
     Student student = new Student("Peter", "PePo", 15);
     student.PropertyChanged += (sender, eventArgs) =>
     {
         Console.WriteLine("Property changed: {0} (from {1} to {2})",
             eventArgs.PropertyName, eventArgs.OldValue, eventArgs.NewValue);
     };
     student.FirstName = "Maria";
     student.Age = 19;
 }
Ejemplo n.º 13
0
        static void Main(string[] args)
        {
            Student newStudent = new Student();

            Type type = newStudent.GetType();

            foreach (var item in type.GetProperties())
            {
                Console.WriteLine(item);
            }
        }
Ejemplo n.º 14
0
        static void Main()
        {
            //Test clone
            Student testStudent = new Student("Brym", "Brym", "Brym", 234567, "lqlqlqlqlq", "04895749875", "lasdhk@kajs", University.Uni1, Faculty.Fakultet1, Specialty.Spec1, 4);
            Student cloneStudent = testStudent.Clone();
            Console.WriteLine("Are students equal? : {0}", testStudent.Equals(cloneStudent));

            //Test deep copy and ToStirng()
            cloneStudent.SSN = 1111111;
            Console.WriteLine(cloneStudent);
        }
Ejemplo n.º 15
0
 static void Main(string[] args)
 {
     string a, b;
     double c;
     a = Console.ReadLine();
     b = Console.ReadLine();
     c = double.Parse(Console.ReadLine());
     Student s = new Student(a, b, c);
     Console.Write(s);
     Console.ReadKey();
 }
Ejemplo n.º 16
0
        private static void Main()
        {
            Student ivan = new Student
            {
                FirstName = "Ivan",
                MiddleName = "Ivanov",
                LastName = "Ivanov",
                Ssn = 1231231231,
                PermanentAddress = "Bulgaria, Sofia 1000, Minzuhar str. 123",
                MobilePhone = "+359887123123",
                Email = "*****@*****.**",
                Course = 2,
                Faculty = FacultyType.Culture,
                University = UniversityType.Private,
                Specialty = SpecialtyType.Bachelor
            };

            Student pesho = new Student
            {
                FirstName = "Pesho",
                MiddleName = "Peshev",
                LastName = "Peshov",
                Ssn = 9999999999,
                PermanentAddress = "Bulgaria, Sofia 1000, Kokiche str. 321",
                MobilePhone = "+359889321321",
                Email = "*****@*****.**",
                Course = 2,
                Faculty = FacultyType.Economic,
                University = UniversityType.Public,
                Specialty = SpecialtyType.Doctor
            };

            Console.WriteLine(ivan);
            Console.WriteLine(pesho);

            Console.WriteLine("Equals: {0}", pesho.Equals(ivan));
            Console.WriteLine("GetHashCode() {0} {1}", "pesho", pesho.GetHashCode());
            Console.WriteLine("GetHashCode() {0} {1}", "ivan", ivan.GetHashCode());

            Console.WriteLine("pesho == ivan {0}", pesho == ivan);
            Console.WriteLine("pesho != ivan {0}", pesho != ivan);

            Student mircho = pesho.Clone();
            mircho.FirstName = "Mircho";
            mircho.MiddleName = "Mirchev";
            mircho.LastName = "Mirchev";
            mircho.Ssn = 9999999999;
            Console.WriteLine("GetHashCode() {0} {1}", "mircho", mircho.GetHashCode());

            Console.WriteLine("Compare: mircho and pesho = " + mircho.CompareTo(pesho));
            Console.WriteLine("Compare: mircho and mircho = " + mircho.CompareTo(mircho));
        }
Ejemplo n.º 17
0
 public static void PrintStudentInfo(Student student)
 {
     Console.WriteLine("  Name:{0} {1} \n  Age:{2} \n  Faculty number:{3} \n  Phone:{4} \n  Email:{5} \n  Marks:{6} \n  Group number:{7}\n",
                            student.FirstName,
                            student.LastName,
                            student.Age,
                            student.FacultyNumber,
                            student.Phone,
                            student.Email,
                            string.Join(";", student.Marks),
                            student.GroupNumber
                          );
 }
Ejemplo n.º 18
0
 static void Main(string[] args)
 {
     Student ahs = new Student("Asd", "Dasd", "Fad", "FN34534", "Sofia, 1400", "+359888888888", "*****@*****.**", 3, Specialties.Biologia, Universities.SU, Faculties.FHF);
     Student asd = new Student("Asd", "Dasd", "Fad", "FN34534", "Sofia, 1400", "+359888888888", "*****@*****.**", 3, Specialties.Biologia, Universities.SU, Faculties.FHF);
     Student clone = asd.Clone();
     Student notclone = asd;
     clone.FirstName = "AAAAAAAAAAA";
     notclone.FirstName = "ddd";
     Console.WriteLine(asd.FirstName);
     Console.WriteLine(clone.FirstName);
     Console.WriteLine(ahs.CompareTo(clone) == 0);
     Console.WriteLine(ahs.CompareTo(asd));
 }
Ejemplo n.º 19
0
        static void Main(string[] args)
        {
            Student myStudent = new Student();

            myStudent.FirstName = "Pesho";
            myStudent.LastName = "Dimitrov";
            myStudent.Faculty = Faculty.IT;
            myStudent.University = University.TelerikAcademy;
            myStudent.Specialty = Specialty.Chemistry;

            // testing cloning
            var clonedStudent = myStudent.Clone() as Student;
            Console.WriteLine("clonedStudent is Student: {0}", clonedStudent is Student);

            // Testing deep cloning
            myStudent.FirstName = "Zdravko";
            Console.WriteLine("myStudent: {0}", myStudent.FirstName);
            Console.WriteLine("clonedStudent: {0}", clonedStudent.FirstName);

            clonedStudent.FirstName = "Zdravko";
            Console.WriteLine("myStudent: {0}", myStudent.FirstName);
            Console.WriteLine("clonedStudent: {0}", clonedStudent.FirstName);

            // testing Equals
            Console.WriteLine("myStudent.Equals(clonedStudent): {0}", myStudent.Equals(clonedStudent));

            // testing .ToString();
            Console.WriteLine("clonedStudent Information: \n {0}", clonedStudent.ToString());
            // testing .GetHashCode();
            Console.WriteLine("GetHashCode() = {0}", clonedStudent.GetHashCode());

            // testing == and !=
            Console.WriteLine("myStudent==clonedStudent: {0}", myStudent == clonedStudent);
            Console.WriteLine("myStudent!=clonedStudent: {0}", myStudent != clonedStudent);

            // testing CompareTo
            Console.WriteLine("myStudent.CompareTo(clonedStudent): {0}", myStudent.CompareTo(clonedStudent));

            myStudent.FirstName = "AAAA";
            Console.WriteLine("myStudent.CompareTo(clonedStudent): {0}", myStudent.CompareTo(clonedStudent));
            myStudent.FirstName = "ZZZZ";
            Console.WriteLine("myStudent.CompareTo(clonedStudent): {0}", myStudent.CompareTo(clonedStudent));
            clonedStudent.FirstName = "ZZZZ";
            Console.WriteLine("myStudent.CompareTo(clonedStudent): {0}", myStudent.CompareTo(clonedStudent));
            clonedStudent.SSN = "123";
            Console.WriteLine("myStudent.CompareTo(clonedStudent): {0}", myStudent.CompareTo(clonedStudent));
            myStudent.SSN = "456";
            Console.WriteLine("myStudent.CompareTo(clonedStudent): {0}", myStudent.CompareTo(clonedStudent));
        }
Ejemplo n.º 20
0
        public static void Main()
        {
            Student vankata = new Student("Ivan", "Ivanov", "Ivanov", "123456789", "Grad Sofia", "0888123456", 3, UniversityEnum.UNSS, FacultyEnum.Law, SpecialtyEnum.PublicLaw);

            Student cloningOfVankata = (Student)vankata.Clone();

            Student bugCloningOfVankata = new Student("Ivan", "Ivanov", "Ivanov", "123456798", "Grad Sofia", "0888123456", 3, UniversityEnum.UNSS, FacultyEnum.Law, SpecialtyEnum.PublicLaw);

            Console.WriteLine(vankata.ToString());
            Console.WriteLine(vankata.GetHashCode());
            Console.WriteLine(vankata.Equals(cloningOfVankata)); // return true
            Console.WriteLine(vankata == bugCloningOfVankata);   // return false
            Console.WriteLine(vankata != cloningOfVankata);      // return false
            Console.WriteLine(vankata.CompareTo(bugCloningOfVankata)); // returns -1
        }
Ejemplo n.º 21
0
        static void Main()
        {
            Student Pesho = new Student("Pesho", "P", "Peshev", "12344", "Sofia", "08989898989", "*****@*****.**");
            Pesho.FillUniversityInfo(Student.UniversityEnum.SofiaUniversity, 2, Student.FacultyEnum.Mathematics, Student.SpecialityEnum.Programming);

            Student Gosho = new Student("Gosho", "G", "Goshev", "12345", "Sofia", "08987362526", "*****@*****.**");
            Gosho.FillUniversityInfo(Student.UniversityEnum.UNSS, 3, Student.FacultyEnum.Economy, Student.SpecialityEnum.BussinesRelations);

            Console.WriteLine(Pesho);
            Console.WriteLine(Gosho);
            Console.WriteLine(Pesho == Gosho);
            Console.WriteLine(Pesho.Equals(Pesho));
            Console.WriteLine(Pesho.Equals(Gosho));
            Console.WriteLine(Pesho != Gosho);
        }
Ejemplo n.º 22
0
        static void Main(string[] args)
        {
            Student student = new Student("Niki", "S", "Kostov", 10002922, "Telerik", "+359 882", "*****@*****.**");
            student.FillUniversityInfo(Student._University.SofiaUniversity, 4, Student._Faculty.Mathematics, Student._Speciality.IT);
            Console.WriteLine(student.GetHashCode());
            Student student2 = new Student("Ivo", "S", "Kenov", 10034222, "Telerik", "+359 883", "*****@*****.**");
            student2.FillUniversityInfo(Student._University.TechnicalUniversity, 4, Student._Faculty.Mathematics, Student._Speciality.IT);
            Console.WriteLine(student2.GetHashCode() + Environment.NewLine);

            Console.WriteLine(student);
            Console.WriteLine(student2);
            Console.WriteLine(student == student2);
            Console.WriteLine(student.Equals(student));
            Console.WriteLine(student.Equals(student2));
            Console.WriteLine(student != student2);
        }
Ejemplo n.º 23
0
        static void Main(string[] args)
        {
            Student ivan = new Student("Ivan", "Ivanov", "Ivanov", "0000", "Sofia", "+359*********",
                "*****@*****.**", 2, University.NewBulgarianUniversity, Faculty.MathmetaticsInformatics, Speciality.ComputerScience);
            Console.WriteLine(ivan);
            Student ivancho = new Student("Ivan", "Ivanov", "Ivanov", "0000", "Varna", "+359*********",
                "*****@*****.**", 2, University.SofiaUniversity, Faculty.Marketing, Speciality.Tourism);
            Console.WriteLine(ivancho);
            Console.WriteLine("Ivan == Ivancho -> {0}", ivan == ivancho);
            Console.WriteLine("Ivancho equals ivan -> {0}", ivancho.Equals(ivan));

            Student ivan2 = ivan.Clone() as Student;
            ivan.LastName = "Ivanovski";

            Console.WriteLine("ivan == ivan2 -> {0}", ivan == ivan2);

            Console.WriteLine("Comparing ivan2 with ivan -> {0}", ivan2.CompareTo(ivan));
        }
Ejemplo n.º 24
0
 static void Main()
 {
     //01
     Student st1 = new Student("Ivan", "Petkov", "Ivanov", "0123456789");
     Student st2 = new Student("Petkan", "Petkov", "Slivanov", "9874561230");
     Student st3 = new Student("Mariq", "Marova", "Mareva", "1230456789");
     Student st4 = new Student("Mariq", "Marova", "Mareva", "0230456789");
     Console.WriteLine("This is 01 exercise:");
     Console.WriteLine(st1.ToString());
     Console.WriteLine(st2.ToString());
     Console.WriteLine("Are those two Equal ?");
     Console.WriteLine(Equals(st1,st2));
     Console.WriteLine();
     //02
     Console.WriteLine("This is 02 exercise:");
     Student cloneSt1 = st1.Clone();
     Console.WriteLine("This is the clone of st1 Say Hi :");
     Console.WriteLine(cloneSt1.ToString());
     Console.Write("Are they really identical ? --> {0}",Equals(st1,cloneSt1));
     cloneSt1.FirstName = "Pencho";
     Console.WriteLine();
     Console.WriteLine("After change first name ? -> {0}",Equals(st1,cloneSt1));
     Console.WriteLine();
     //03
     Console.WriteLine("This is 03 exercise:");
     List<Student> studentList = new List<Student>();
     studentList.Add(st1);
     studentList.Add(st2);
     studentList.Add(st3);
     studentList.Add(st4);
     Console.WriteLine("Before Sorting");
     foreach (var student in studentList)
     {
         Console.WriteLine(student.ToString());
     }
     studentList.Sort();
     Console.WriteLine("And this is after ");
     foreach (var student in studentList)
     {
         Console.WriteLine(student.ToString());
     }
     //
 }
Ejemplo n.º 25
0
        static void Main(string[] args)
        {
            //test
            Student student1 = new Student(
                "Pesho", "Ivanov", "Peshev", "A11-11-1111", 1, Enums.Univercity.Cambridge,
                Enums.Specialty.Humanities, Enums.Faculty.History);
            Student student2 = new Student(
                "Gosho", "Ivanov", "Goshev", "111-22-1111", 1, Enums.Univercity.Oxford,
                Enums.Specialty.Social, Enums.Faculty.Law);

            //print students
            Console.WriteLine(student1.ToString());
            Console.WriteLine(student2.ToString());

            //compare students
            if (student1.CompareTo(student2)<0)
            {
                Console.WriteLine("student1 is before student2!" + "\n");
            }
            if (student1.CompareTo(student2) > 0)
            {
                Console.WriteLine("student1 is after student2!" + "\n");
            }
            if (student1.CompareTo(student2) == 0)
            {
                Console.WriteLine("student1 is after student2!" + "\n");
            }

            //clone Student1 and print it
            Student student3 = student1.Clone();
            Console.WriteLine(student3);

            //check if students are equal
            if (student1 == student2)
            {
                Console.WriteLine("student1 is equal to student2!");
            }
            else if (student1 != student2)
            {
                Console.WriteLine("student1 is NOT equal to student2!");
            }
        }
Ejemplo n.º 26
0
 static void Main(string[] args)
 {
     int n = int.Parse(Console.ReadLine());
     Student[] KBTU = new Student[110];
     for (int i = 0; i < n; ++i)
     {
         string s = Console.ReadLine();
         string[] token = s.Split();
         try {
             KBTU[i] = new Student(token[0], token[1], Convert.ToDouble(token[2]));
         } 
         catch (Exception e)
         {
             Console.WriteLine(e.Message);
         }
     }
     for (int i = 0; i < n; ++i)
         Console.WriteLine(KBTU[i]);
     Console.ReadKey();
 }
Ejemplo n.º 27
0
 static void Main(string[] args)
 {
     //public Student(string firstName, string middleName, string lastName, string ssn, string address,
     //string phone, string email, byte course, Speciality speciality, University university, Faculty faculty)
     Student firstStudent = new Student("Ivan","Ivanov","Ivanov","123456789","Sofia city","0888888888"
         ,"*****@*****.**",2,Speciality.ComputerSystem,University.NewBulgarianUniversity,Faculty.FKSU);
     Console.WriteLine(firstStudent);
     Student secondStudent = firstStudent.Clone() as Student;
     Console.WriteLine(secondStudent);
     secondStudent.Ssn = "000123784";
     Student thirdStudent = new Student("Pesho", "Ivanov", "Peshov", "123456789", "Sofia city", "0888888888"
         , "*****@*****.**", 3, Speciality.InformationTechnologies, University.SofiaUniversity, Faculty.FMI);
     Console.WriteLine(thirdStudent);
     Student[] students = { firstStudent, secondStudent, thirdStudent };
     Array.Sort(students);
     Console.WriteLine("Sorted...");
     foreach (Student student in students)
     {
         Console.WriteLine(student);
     }
 }
Ejemplo n.º 28
0
        static void Main()
        {
            Student[] listOfStudents = new Student[]
            {
                new Student("Petar", "Petrov", 21),
                new Student("Stamat", "Doichinov", 22),
                new Student("Gosho", "Todorov", 17),
                new Student("Ivan", "Zahariev", 30),
                new Student("Zahari", "Ivanov", 12),
                new Student("Albena", "Albenova", 23),
                new Student("Albena", "Ivanova", 31),
                new Student("Ivan", "Albenov", 18)
            };

            var result =
                from st in listOfStudents
                where (st.Age >= 18 && st.Age <= 24)
                select st;

            Student.Information(result);
        }
        public static void Main()
        {
            // test Equal()
            var firstStudent = new Student("Marshall", "Bruce", "Mathers", 113);
            firstStudent.Email = "*****@*****.**";

            var secondStudent = new Student("Tupac", "Amaru", "Shakur", 113, Universities.UNWE, Faculties.BusinessFaculty, Specialties.IndustrialBusiness);

            bool isEqualStrings = firstStudent.Equals(secondStudent);

            Console.WriteLine("{0}\n{1}\nAre they equal? -> {2}\n", firstStudent, secondStudent, isEqualStrings);

            // test Clone()
            var thirdStudent = firstStudent.Clone();
            thirdStudent.Email = "*****@*****.**";
            Console.WriteLine(firstStudent.Email);
            Console.WriteLine(thirdStudent.Email);
            Console.WriteLine();

            // test CompareTo()
            Console.WriteLine(firstStudent.CompareTo(secondStudent)); // -1 if first < second
        }
Ejemplo n.º 30
0
        public static void Main(string[] args)
        {
            /* Testing the Student class */
            Student[] stds = new Student[7];
            stds[0] = new Student ();
            stds[1] = new Student ("s1","57001");
            stds[2] = new Student ("s2","57002",1994);
            stds[3] = new Student ("s3","57003",1996);
            stds[4] = new Student ("s4","57004");
            stds[5] = new Student ("s5","57005",1993);
            stds[6] = new Student ("s6","57006");

            Console.WriteLine ("\n--- Initial Students' state ---");
            foreach (Student s in stds)
                Console.WriteLine (s);

            Console.WriteLine ("\n--- Playing with s4, s5, s6 objects ---");
            stds [4].setName("Mario");
            stds [5].setYob(1900);
            stds [6].setActive(false);
            for (int i = 4; i < stds.Length; i++)
                Console.WriteLine (stds [i]);
            Console.ReadLine();
        }
Ejemplo n.º 31
0
 static void Main(string[] args)
 {
     Student a = new Student("Miras", "Temirbay", 4.0);
     Console.WriteLine(a);
     Console.ReadKey();
 }
Ejemplo n.º 32
0
        public static void AddStudent(Student s)
        {
            slist[count++] = s;

            Console.WriteLine("Student Added");
        }