当前位置: 首页>>代码示例>>C#>>正文


C# School.ToString方法代码示例

本文整理汇总了C#中School.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# School.ToString方法的具体用法?C# School.ToString怎么用?C# School.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在School的用法示例。


在下文中一共展示了School.ToString方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Main

        static void Main()
        {
            Class firstClass = new Class("8b");
            School school = new School("My school");
            school.Classes.Add(firstClass);
            //Console.WriteLine(school.ToString());
            firstClass.FillWithStudents();

            Teacher Joreto = new Teacher("Joreto");
            Joreto.Disciplines.Add(new Discipline("Math", 1, 1));
            Joreto.Disciplines.Add(new Discipline("Physic", 2, 3));
            Joreto.Disciplines.Add(new Discipline("Drawing", 3, 3));

            Teacher Pesho = new Teacher("Pesho");
            Pesho.Disciplines.Add(new Discipline("Math", 1, 1));
            Pesho.Disciplines.Add(new Discipline("Physic", 2, 3));

            firstClass.Teachers.Add(Joreto);
            firstClass.Teachers.Add(Pesho);
            Console.WriteLine("Teacher");
            Console.WriteLine(firstClass.Teachers.ToString());

            Console.WriteLine(firstClass.ToString());
            Console.WriteLine("end of haha");
            Console.WriteLine(school.ToString());

            Console.WriteLine(school.Classes[0].Teachers[0].ToString());
        }
开发者ID:BobbyBorisov,项目名称:TelerikAcademy,代码行数:28,代码来源:School_project.cs

示例2: Main

 static void Main()
 {
     //Student test
     //Console.WriteLine("Student test");
     List<Student> studentsList = new List<Student>();
     studentsList.Add(new Student("Vesi", 1231532));
     studentsList.Add(new Student("Natalia", 462346));
     studentsList.Add(new Student("Mitko", 0982374));
     //Console.WriteLine(studentsList.Print());
     //Teacher test
     //Console.WriteLine("Teacher test");
     List<Teacher> teachersList = new List<Teacher>();
     teachersList.Add(new Teacher("prof. Petrov"));
     teachersList.Add(new Teacher("doc. Hristov"));
     teachersList.Add(new Teacher("as. Doneva"));
     teachersList[0].AddDiscipline("Computer sciense", 4, 5);
     teachersList[0].AddDiscipline("Hardware basics", 3, 2);
     teachersList[1].AddDiscipline("C# Basics", 4, 4);
     teachersList[1].AddDiscipline("C# OOP", 5, 5);
     teachersList[2].AddDiscipline("Operating Systems", 3, 2);
     //Console.WriteLine(teachersList.Print());
     //Class test
     //Console.WriteLine("Class test");
     Class classA = new Class('A', teachersList, studentsList);
     //Console.WriteLine(classA.ToString());
     Class classB = new Class('B', teachersList, studentsList);
     classB.Comments = "This is class B";
     //School test
     Console.WriteLine("School test:");
     School TUES = new School();
     TUES.AddClass(classA);
     TUES.AddClass(classB);
     Console.WriteLine(TUES.ToString());
 }
开发者ID:KirilToshev,项目名称:Projects,代码行数:34,代码来源:SchoolTest.cs

示例3: Main

 static void Main()
 {
     // creating teachers
        // we need e set of discip
     Disciplines disc1 = new Disciplines("Math", 23, 140);
     Disciplines disc2 = new Disciplines("Biology", 23, 140);
     Disciplines disc3 = new Disciplines("OOP", 23, 140);
     IList<Disciplines> disciplines = new List<Disciplines>();
     disciplines.Add(disc1);
     disciplines.Add(disc2);
     disciplines.Add(disc3);
     //disciplines can have comments
     disc1.Comment("I am free this week");
     // and that is the teacher with his disciplines
     Teachers teacher1 = new Teachers("Petrow",disciplines);
     //he can make comments
     teacher1.Comment("Ivancho is bad");
     //you can see his comment
     Console.WriteLine(teacher1.SayComment());
     //we can make second teacher and than a set of teachers
     Teachers teacher2 = new Teachers("Stoqnow", disciplines);
     IList<Teachers> setOfTeachers = new List<Teachers>();
     setOfTeachers.Add(teacher1);
     setOfTeachers.Add(teacher2);
     // to create a class we need and a set of students
     // first we create a few students
     Students student1 = new Students("Ivancho", 7);
     Students student2 = new Students("Mariika", 16);
     Students student3 = new Students("Qworcho",25);
     IList<Students> setOfStudents = new List<Students>();
     setOfStudents.Add(student1);
     setOfStudents.Add(student2);
     setOfStudents.Add(student3);
     // now we can ctreate class
     Classes class1 = new Classes("10b", setOfStudents, setOfTeachers);
     // the classes can make comments
     class1.Comment("We are happy class");
     // finaly we make a list of classes
     Classes class2 = new Classes("11v",setOfStudents,setOfTeachers);
     IList<Classes> setOfClasses = new List<Classes>();
     setOfClasses.Add(class1);
     setOfClasses.Add(class2);
     //school
     School school1 = new School(setOfClasses);
     Console.WriteLine(school1.ToString());
 }
开发者ID:naturalna,项目名称:OOPPrinciples,代码行数:46,代码来源:SchoolEntryPoint.cs

示例4: Main

        static void Main(string[] args)
        {
            List<Disciplines> teacherPeshoDisciplines = new List<Disciplines>
            {
                new Disciplines("C#", 3, 4, "hgfsdfsdf"),
                new Disciplines("PHP", 1, 2)
            };

            List<Disciplines> teacherLelqDisciplines = new List<Disciplines>
            {
                new Disciplines("C#", 3, 4, "hgfsdfsdf"),
                new Disciplines("PHP", 1, 2)
            };

            Teacher teacherPesho = new Teacher("Pesho", "Ivanov", teacherPeshoDisciplines);
            Teacher teacherLelq = new Teacher("Lelq", "Peshva", teacherLelqDisciplines);

            Student studentChocho = new Student("Chocho", "Goshev", 111);
            Student studentLucho = new Student("Lucho", "Peshev", 1111);

            List<Teacher> donatelloTeachers = new List<Teacher>
            {
                teacherPesho,
                teacherLelq
            };

            List<Student> donatelloStudents = new List<Student>
            {
                studentChocho,
                studentLucho
            };

            List<SchoolClasses> donatello = new List<SchoolClasses>
            {
                new SchoolClasses("donatelo", donatelloTeachers, donatelloStudents)
            };

            School telerik = new School("Telerik", donatello);

            Console.WriteLine(telerik.ToString());
        }
开发者ID:siropo,项目名称:Telerik_academy_homework,代码行数:41,代码来源:Program.cs

示例5: Main

        static void Main(string[] args)
        {
            //Defining Student
            Student student = new Student("John", "Smith", 1234322);
            //Console.WriteLine(student.ToString());
            //Defining Teacher
            Teacher teacher = new Teacher("John", "Doe");
            teacher.AddElement(DisciplineName.Biology);
            teacher.AddElement(DisciplineName.Science);
            //Console.WriteLine(teacher.ToString());

            //Defining Class
            Classes newClass = new Classes("143A");
            newClass.AddElement(student);
            newClass.AddElement(teacher);
            //Console.WriteLine(newClass.ToString());
            //Defining School
            School school = new School();
            school.AddElement(newClass);
            Console.WriteLine(school.ToString());
        }
开发者ID:aleks-todorov,项目名称:HomeWorks,代码行数:21,代码来源:Application.cs

示例6: Main

    static void Main()
    {
        School svishtovSchool = new School("State high school of economics \"Dimitar Hadzhivasilev\"");
        Class first = new Class("1es42QwE", "We are number one!");
        first.Students.Add(new Student("Petar", 16, 1, "Quite noisy this guy..."));
        first.Students.Add(new Student("Georgi", 15, 2));
        first.Students.Add(new Student("Penka", 17, 3, "A programmer girl. Can you believe it?"));

        Teacher petkov = new Teacher("Petkov", 42);
        Teacher dimitrov = new Teacher("Dimitrov", 48);

        Discipline history = new Discipline("History", 18);
        history.Students.Add(new Student("Nasko", 14, 4));

        petkov.Disciplines.Add(history);
        dimitrov.Disciplines.Add(new Discipline("Geography", 12));

        first.Teachers.Add(petkov);
        first.Teachers.Add(dimitrov);
        svishtovSchool.Classes.Add(first);

        Console.WriteLine(svishtovSchool.ToString());
    }
开发者ID:shnogeorgiev,项目名称:Software-University-Courses,代码行数:23,代码来源:SchoolDemo.cs

示例7: Main

    static void Main()
    {
        // Creating students
        Student firstStudent = new Student("Dimitar Penev", 1);
        Student secondStudent = new Student("Emil Kostadinov", 2);
        Student thirdStudent = new Student("Krasimir Balakov", 3);
        Student fourthStudent = new Student("Zdravko Zdravkov", 4);

        // Creating disciplines
        Discipline biology = new Discipline("Biology", 8, 4);
        Discipline mathematics = new Discipline("Mathematics", 4, 2);
        Discipline economics = new Discipline("Economics", 4, 4);

        // Creating teachers
        Teacher firstTeacher = new Teacher("Kiril Hristov", new List<Discipline>() { biology });
        Teacher secondTeacher = new Teacher("Atanas Dalchev", new List<Discipline>() { mathematics });
        Teacher thirdTeacher = new Teacher("Isaac Newton", new List<Discipline>() { mathematics, economics });

        // Creating class
        Class griffindor = new Class("Griffindor", new List<Student>() { firstStudent, secondStudent, thirdStudent, fourthStudent }, new List<Teacher>() { firstTeacher, secondTeacher, thirdTeacher });

        // Creating school
        School kokiche = new School(new List<Class>() { griffindor });

        thirdStudent.SetComment("Hard-working");
        secondTeacher.SetComment("Lazy");
        griffindor.SetComment("Underachieving");
        biology.SetComment("Hard");

        Console.WriteLine(kokiche.ToString());

        Console.WriteLine("Displaying comments:");
        Console.WriteLine(thirdStudent.GetComment());
        Console.WriteLine(secondTeacher.GetComment());
        Console.WriteLine(griffindor.GetComment());
        Console.WriteLine(biology.GetComment());
    }
开发者ID:klimentt,项目名称:Telerik-Academy,代码行数:37,代码来源:TestProgram.cs

示例8: GetValueFromSchool

		public int GetValueFromSchool(School schl) {
			return GetValueFromTag (schl.ToString ());
		}
开发者ID:TobiasMorell,项目名称:Game2Grow-Wizard,代码行数:3,代码来源:ItemDatabase.cs

示例9: AddValueToSchool

		public void AddValueToSchool(School schl, int value) {
			AddValueToTag (schl.ToString (), value);
		}
开发者ID:TobiasMorell,项目名称:Game2Grow-Wizard,代码行数:3,代码来源:ItemDatabase.cs


注:本文中的School.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。