예제 #1
0
        public Exam CreateExam(string name, double duration, string coursePlan, FacultyMember prof, string room) // method used to Create an Exam
        {
            Exam exam = new Exam(name, duration, coursePlan, prof, room, new List <Student>());                  // here is the new Object Exam

            Console.WriteLine("This Exam as been created with succes");                                          // confirmation sentence
            return(exam);
        }
 public Course(string name, double duration, string coursePlan, FacultyMember prof, string room, List <Student> clas)
 {
     this.name       = name;
     this.duration   = duration;
     this.coursePlan = coursePlan;
     this.prof       = prof;
     this.room       = room;
     this.clas       = clas;
 }
        //creating a course and saving the course in a text file
        public Course CreateCourse(string name, double duration, string coursePlan, FacultyMember prof, string room, List <Student> clas)
        {
            Course a = new Course(name, duration, coursePlan, prof, room, clas);

            Console.WriteLine($"the course {a.Name} has been created");   //confirmation that the course has been created
            string path = "./Course.txt";

            using (StreamWriter sw = File.AppendText(path))
            {
                sw.Write($"{name},{duration},{coursePlan},{prof.Name},{room},");
                foreach (Student studentTest in clas)
                {
                    sw.Write(studentTest.Name + " ");
                }
                sw.WriteLine();
            }
            return(a);
        }
        public Exam(string name, double duration, string coursePlan, FacultyMember prof, string room, List<Student> clas) : base(name, duration, coursePlan, prof, room, clas)
        {

        }
 public Project(string name, double duration, string coursePlan, FacultyMember prof, string room) : base(name, duration, coursePlan, prof, room)
 {
 }