Exemple #1
0
        public void Add(StudentElem stud, SubjectElem subj, ASSESSMENT assessment)
        {
            StudentElem stud_temp = _Student.Find(stud.FIO);
            SubjectElem subj_temp = _Subject.Find(subj.Name);
            bool stud_null = (stud_temp == null);
            bool subj_null = (subj_temp == null);

            if (stud_null && subj_null)
            {
                stud.Add(subj, assessment);
                _Student.Add(stud);
                _Subject.Add(subj);
            }
            else if (!stud_null && subj_null)
            {
                stud_temp.Add(subj, assessment);
                _Subject.Add(subj);
            }
            else if (stud_null && !subj_null)
            {
                stud.Add(subj_temp, assessment);
                _Student.Add(stud);
            }
            else if (!stud_null && !subj_null)
                stud_temp.Add(subj_temp, assessment);
        }
Exemple #2
0
        static void Addition(Statistics st)
        {
            // Students
            StudentElem BAI = new StudentElem("Berezin Alexey Ivanovich", new DateTime(1994, 1, 26));
            StudentElem DRU = new StudentElem("Daineko Roman Urievich", new DateTime(1994, 10, 5));
            StudentElem SNS = new StudentElem("Shaykhinurov Nail Shamilevich", new DateTime(1995, 1, 27));
            StudentElem VMU = new StudentElem("Vymenets Maxim Yuryevich", new DateTime(1995, 10, 14));
            StudentElem HDD = new StudentElem("Hohlova Daria Dmitrievna", new DateTime(1994, 11, 22));

            // Student info
            StudentInfo BAI_info = new StudentInfo(BAI.FIO, 1);
            StudentInfo DRU_info = new StudentInfo(DRU.FIO, 2);
            StudentInfo SNS_info = new StudentInfo(SNS.FIO, 3);
            StudentInfo VMU_info = new StudentInfo(VMU.FIO, 4);
            StudentInfo HDD_info = new StudentInfo(HDD.FIO, 5);

            // Subjects
            SubjectElem matan = new SubjectElem("Matan", 1, 1, CREDIT.EXAM, "Dodonov");
            SubjectElem algebra = new SubjectElem("Algebra", 1, 1, CREDIT.EXAM, "Shmidt");
            SubjectElem history = new SubjectElem("History", 1, 1, CREDIT.TEST, "Nalivaiko");
            SubjectElem po = new SubjectElem("Programming Foundation", 1, 1, CREDIT.EXAM, "Lavrov");

            // Adding

            // BAI
            st.Add(BAI, matan, ASSESSMENT.GOOD);
            st.Add(BAI, algebra, ASSESSMENT.GOOD);
            st.Add(BAI, history, ASSESSMENT.PASSED);
            st.Add(BAI, po, ASSESSMENT.GOOD);
            // DRU
            st.Add(DRU, matan, ASSESSMENT.SATISFACTORY);
            st.Add(DRU, algebra, ASSESSMENT.GOOD);
            st.Add(DRU, history, ASSESSMENT.PASSED);
            st.Add(DRU, po, ASSESSMENT.EXCELLENT);
            // SNS
            st.Add(SNS, matan, ASSESSMENT.SATISFACTORY);
            st.Add(SNS, algebra, ASSESSMENT.SATISFACTORY);
            st.Add(SNS, history, ASSESSMENT.PASSED);
            st.Add(SNS, po, ASSESSMENT.SATISFACTORY);
            // VMU
            st.Add(VMU, matan, ASSESSMENT.GOOD);
            st.Add(VMU, algebra, ASSESSMENT.GOOD);
            st.Add(VMU, history, ASSESSMENT.PASSED);
            st.Add(VMU, po, ASSESSMENT.EXCELLENT);
            // HDD
            st.Add(HDD, matan, ASSESSMENT.GOOD);
            st.Add(HDD, algebra, ASSESSMENT.GOOD);
            st.Add(HDD, history, ASSESSMENT.PASSED);
            st.Add(HDD, po, ASSESSMENT.EXCELLENT);

            st.AddInfo(BAI_info);
            st.AddInfo(DRU_info);
            st.AddInfo(SNS_info);
            st.AddInfo(VMU_info);
            st.AddInfo(HDD_info);
        }
Exemple #3
0
 public SubjectEnumerator(SubjectElem [] list)
 {
     subject = list;
 }
Exemple #4
0
 public SubjectElem(SubjectElem subj, ASSESSMENT assessment)
 {
     Name = subj.Name;
     Year = subj.Year;
     Semester = subj.Semester;
     Credit = subj.Credit;
     Lecturer = subj.Lecturer;
     Assessment = assessment;
 }
Exemple #5
0
 public SubjectElem(SubjectElem subj)
 {
     Name = subj.Name;
     Year = subj.Year;
     Semester = subj.Semester;
     Credit = subj.Credit;
     Lecturer = subj.Lecturer;
     Assessment = subj.Assessment;
 }
Exemple #6
0
 public void Add(SubjectElem subj)
 {
     subject[count] = new SubjectElem(subj);
     count++;
     if (count == max_count)
     {
         SubjectElem [] temp = subject;
         max_count += 10;
         subject = new SubjectElem[max_count];
         for (int i = 0; i < temp.Length; i++)
             subject[i] = temp[i];
     }
 }
Exemple #7
0
 public void Add(SubjectElem subj, ASSESSMENT assessment)
 {
     Subject[count] = new SubjectElem(subj, assessment);
     count++;
     if (count == max_count)
     {
         int length = Subject.Length;
         SubjectElem [] temp = Subject;
         max_count += 10;
         Subject = new SubjectElem[max_count];
         for (int i = 0; i < length; i++)
             Subject[i] = temp[i];
     }
 }
Exemple #8
0
 public StudentElem(string fio, DateTime birthday)
 {
     FIO = fio;
     Birthday = birthday;
     max_count = 10;
     count = 0;
     Subject = new SubjectElem[max_count];
 }