本文整理汇总了C#中Student.AddComment方法的典型用法代码示例。如果您正苦于以下问题:C# Student.AddComment方法的具体用法?C# Student.AddComment怎么用?C# Student.AddComment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Student
的用法示例。
在下文中一共展示了Student.AddComment方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main()
{
//some tests
Student go6o = new Student("Go6o", 1245);
Student to6o = new Student("To6o", 2345);
to6o.AddComment("YOU SHAL NOT PAAAAASSS!!!");
to6o.AddComment("To be expelled");
Discipline borringStuff = new Discipline("Borring Stuff", 100, 1);
List<Discipline> profesorovDisciplines = new List<Discipline>()
{
borringStuff
};
Teacher profesorov = new Teacher("Profesorov", profesorovDisciplines);
//create class
List<Student> class1AStudents = new List<Student>()
{
to6o, go6o
};
List<Teacher> class1ATeachers = new List<Teacher>()
{
profesorov
};
List<SchoolClass> TUClasses2 = new List<SchoolClass>()
{
new SchoolClass(class1AStudents, "Class 1-A", class1ATeachers)
};
School TU = new School(TUClasses2);
}
示例2: Main
static void Main()
{
HashSet<Teacher> teachers =new HashSet<Teacher>();
HashSet<Student> students =new HashSet<Student>();
HashSet<Discipline> discipline = new HashSet<Discipline>();
HashSet<Class> classes = new HashSet<Class>();
School EmilianStanev = new School(classes);
Class IA = new Class(teachers, students, "IA");
Class IB = new Class(teachers, students, "IB");
Class IC = new Class(teachers, students, "IC");
Teacher Georgi = new Teacher("Georgi Georgiev", discipline);
Teacher Petar = new Teacher("Petar Avramov", discipline);
Teacher Stamat = new Teacher("Stamat Ivanov", discipline);
Discipline Matematica = new Discipline("Matematica", 5, 7);
Discipline Literature = new Discipline("Literature", 4, 8);
Discipline English = new Discipline("English", 7, 9);
Discipline History = new Discipline("History", 3, 1);
Discipline Geography = new Discipline("Geography", 2, 1);
Discipline Fizichesko = new Discipline("Fizichesko", 1, 1);
Georgi.AddDiscipline(Matematica);
Georgi.AddDiscipline(Literature);
Georgi.AddDiscipline(English);
Petar.AddDiscipline(History);
Petar.AddDiscipline(Geography);
Stamat.AddDiscipline(Fizichesko);
Georgi.RemoveDiscipline(Literature);
Student Alex = new Student("Alex Kostadinov", "1");
Student Veronica = new Student("Veronika Stancheva", "5");
Student Benedeta = new Student("Benedeta Kucarova", "2");
Student Caroline = new Student("Caroline Simpson", "3");
Student David = new Student("David Jhones", "4");
Student Megan = new Student("Megan Fox", "6");
Student Philip = new Student("Philip Avramov", "7");
EmilianStanev.AddClass(IA);
IA.AddTeacher(Georgi);
IA.AddTeacher(Petar);
IA.AddStudent(Alex);
IA.AddStudent(Veronica);
IA.AddStudent(Benedeta);
IB.AddTeacher(Georgi);
IB.AddTeacher(Stamat);
IB.AddStudent(Caroline);
IB.AddStudent(David);
IC.AddTeacher(Petar);
IC.AddTeacher(Georgi);
IC.AddTeacher(Stamat);
IC.AddStudent(Megan);
IC.AddStudent(Philip);
EmilianStanev.AddClass(IB);
EmilianStanev.AddClass(IC);
Veronica.AddComment("The smartest girl in class");
IA.AddComment("IA is the coolest class ever");
Matematica.AddComment("Matematica is the best Subject!");
Console.WriteLine(EmilianStanev.ToString());
}
示例3: Main
static void Main()
{
// == Disciplines ==
Discipline math = new Discipline("Math", 23, 23);
Discipline bio = new Discipline("Bio", 23, 34);
Discipline geo = new Discipline("Geo", 27, 44);
// == Teachers ==
Teacher Dimitar = new Teacher("Dimitar Lilov", 34, Gender.Male);
Dimitar.AddDiscipline(math);
Dimitar.AddDiscipline(bio);
Teacher Kiril = new Teacher("Kiril Nikolov", 29, Gender.Male);
Kiril.AddDiscipline(geo);
// == Students ==
Student Aneliq = new Student("Aneliq Iordanova", 17, Gender.Female, 000354);
Student Yoana = new Student("Yoana Ivanova", 18, Gender.Female, 000359);
Yoana.AddComment("EGN - 2342623623");
// == List Of Teachers ==
List<Teacher> teachers = new List<Teacher>();
teachers.Add(Dimitar);
teachers.Add(Kiril);
// == List Of Students ==
List<Student> students = new List<Student>();
students.Add(Aneliq);
students.Add(Yoana);
// == StudentClass ==
StudentClass firstClass = new StudentClass("10B", students, teachers);
// == School ==
School washington = new School("Washington");
washington.AddSchoolClass(firstClass);
// == Printing ==
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("Printing School ...");
Console.ResetColor();
Console.WriteLine();
Console.WriteLine(washington);
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("Printing Class ...");
Console.ResetColor();
Console.WriteLine();
Console.WriteLine(firstClass);
Console.ReadLine();
}
示例4: Main
static void Main(string[] args)
{
//We are given a school. In the school there are classes of students. Each class
//has a set of teachers. Each teacher teaches a set of disciplines. Students have
//name and unique class number. Classes have unique text identifier. Teachers have
//name. Disciplines have name, number of lectures and number of exercises. Both teachers
//and students are people. Students, classes, teachers and disciplines could have optional
//comments (free text block).
//Your task is to identify the classes (in terms of OOP) and their attributes and operations,
//encapsulate their fields, define the class hierarchy and create a class diagram with Visual Studio.
//I use this class(class Scool) like a scool.
try
{
//Initialize some students
Student joro = new Student("Joro", 19877);
Student petur = new Student("Petur", 19878);
Student ivo = new Student("Ivo", 19879);
//...some disciplines
Discipline math = new Discipline("Mathematic", 8, 5);
Discipline bio = new Discipline("Biology", 7, 3);
// ... teacher
Teacher ivanov = new Teacher("Ivanov");
//Adding some disciplines that he teaching
ivanov.SetOfDisciplines.Add(math);
ivanov.SetOfDisciplines.Add(bio);
//Make a class with students and teacher
Class theBestClass = new Class("The best of the best");
theBestClass.SetOfStudents.Add(joro);
theBestClass.SetOfStudents.Add(petur);
theBestClass.SetOfStudents.Add(ivo);
theBestClass.SetOfTeachers.Add(ivanov);
Console.WriteLine("Our clas - \"{0}\" have {1} studets :\n{2}and {3} teacher(s) :\n{4}"
, theBestClass.UniqueTextIdentifier, theBestClass.SetOfStudents.Count, theBestClass.Students()
, theBestClass.SetOfTeachers.Count, theBestClass.Teachers());
//Add and show some optional comments
ivo.AddComment("Ivo is football player");
ivanov.AddComment("Mr. Ivanov do not like football players.");
Console.WriteLine(ivo.ShowComment()+","+ivanov.ShowComment());
}
catch (Exception ex)
{
Console.WriteLine("Error!" + ex.Message); ;
}
}
示例5: Main
public static void Main()
{
List<Student> students = new List<Student>();
students.Add(new Student("Ivan", 1));
students.Add(new Student("Pesho", 2));
students.Add(new Student("Gosho", 3));
List<Discipline> disciplines = new List<Discipline>();
disciplines.Add(new Discipline("Mathematics", 5, 3));
disciplines.Add(new Discipline("Computers", 1, 2));
List<Teacher> teachers = new List<Teacher>();
teachers.Add(new Teacher("Daskala", disciplines));
Class myClass = new Class(students, teachers, "Informatics");
//Testing comments
Student testingStudent = new Student("Misho", 1);
testingStudent.AddComment("Random Comment for misho");
System.Console.WriteLine(testingStudent.ShowComment());
}
示例6: Main
static void Main()
{
Student stud1 = new Student("Mario", 1);
Student stud2 = new Student("Batman", 4);
Student stud3 = new Student("Optimus Prime", 3);
Student[] students = new Student[] { stud1, stud2, stud3};
Discipline disp1 = new Discipline("OOP", 40, 40);
Teacher teach1 = new Teacher("Morgan Freeman", new Discipline[] { disp1 });
Teacher[] teachers = new Teacher[] {teach1};
Class class1 = new Class(students, teachers, "12A");
Console.Write("The name of the first discipline of the first teacher of the first class: ");
Console.WriteLine(class1.Teachers[0].Disciplines[0].Name);
stud1.AddComment("ninja");
Console.Write("The first comment for the first studdent: ");
Console.WriteLine(stud1.Comments[0]);
}
示例7: Main
//.........这里部分代码省略.........
// Console.WriteLine("Student Identifier:");
// int myClassStudIdent=int.Parse(Console.ReadLine());
// Student studentInMyClass=new Student(myClassStudName,myClassStudIdent);
// myPeple.Add(studentInMyClass);
//}
//Console.WriteLine();
////TEACHERS
//Console.WriteLine("Teachers of my class number:");
//int myTeachersNum = int.Parse(Console.ReadLine());
//List<Teacher> myTeachers = new List<Teacher>();
//for (int i = 0; i < myTeachersNum; i++)
//{
// //DISCIPLINES
// Console.WriteLine("Enter the num of Disciplines:");
// int disciplinesNum = int.Parse(Console.ReadLine());
// List<Discipline> discipline = new List<Discipline>();
// for (int j = 0; j < disciplinesNum; j++)
// {
// Console.WriteLine("Discipline name:");
// string disciplineName = Console.ReadLine();
// Console.WriteLine("num of Lectures:");
// int lecturesNum = int.Parse(Console.ReadLine());
// Console.WriteLine("num of Exercises:");
// int exercisesNum = int.Parse(Console.ReadLine());
// Discipline someDiscipline = new Discipline(disciplineName, lecturesNum, exercisesNum);
// discipline.Add(someDiscipline);
// }
// // TEACHER COMENTS
// Console.WriteLine("number of coment for this Teacher:");
// int teacherComentNum = int.Parse(Console.ReadLine());
// List<string> someComents=new List<string>();
// for (int k = 0; k< teacherComentNum;k++ )
// {
// Console.WriteLine("Add coment about teacher:");
// string coment = Console.ReadLine();
// someComents.Add(coment);
// }
// Coment aboutTeacher = new Coment(someComents);
// Console.WriteLine("Teacher name:");
// string myTeacherName = Console.ReadLine();
// List<Discipline> myTeacherDisciplines = discipline;
// Coment forTecherComent = aboutTeacher;
// Teacher myTeacher=new Teacher(myTeacherName,myTeacherDisciplines,forTecherComent);
// myTeachers.Add(myTeacher);
//}
//Console.WriteLine();
////CLASS
//Console.WriteLine("My class textIdentifier:");
//string textIdentifier = Console.ReadLine();
//Class myClass = new Class(myTeachers, myPeple, textIdentifier);
//Console.WriteLine(mySchool);
////PRINT ALL ENTERED INFORMATION
//Console.WriteLine(" I am:{0}",thisIsMe.HumanName.ToString());
//Console.WriteLine(" Im from:{0}",MySchool.Name.ToString());
//Console.WriteLine("My class is:{0}",myClass.TextIdentifier.ToString());
//for (int i = 0; i < myTeachersNum; i++)
//{
// Console.Write("{0} is my teacher at:",myTeachers[i].Name.ToString());
// for (int j = 0; j < myTeachers[i].TeacherDisciplines.Count; j++)
// {
// Console.Write(" "+myTeachers[i].TeacherDisciplines[j].ToString());
// }
// Console.WriteLine();
// for (int k = 0; k < myTeachers[i].Coments.SomeComents.Count; k++)
// {
// Console.WriteLine(myTeachers[i].Coments.SomeComents[k]);
// }
//}
//Console.WriteLine();
//Console.WriteLine();
//Console.WriteLine();
//Console.WriteLine("STUDENTS IN MY CLASS");
//for (int i = 0; i < myPeple.Count; i++)
//{
// Console.WriteLine("{0}:{1}",myPeple[i].ClassNumber,myPeple[i].Name);
//}
Student stud1 = new Student("Mario", 1);
Student stud2 = new Student("Batman", 4);
Student stud3 = new Student("Optimus Prime", 3);
Student[] students = new Student[] { stud1, stud2, stud3 };
Discipline disp1 = new Discipline("OOP", 40, 40);
Teacher teach1 = new Teacher("Morgan Freeman", new Discipline[] { disp1 });
Teacher[] teachers = new Teacher[] { teach1 };
Class class1 = new Class(students, teachers, "12A");
Console.Write("The name of the first discipline of the first teacher of the first class: ");
Console.WriteLine(class1.Teachers[0].Disciplines[0].Name);
stud1.AddComment("ninja");
Console.Write("The first comment for the first studdent: ");
Console.WriteLine(stud1.Comments[0]);
}