Beispiel #1
0
        static public Degree LoadCPE(DBClass db)
        {
            Degree ce = new Degree("CE");

            ce.RequiredCourses = db.FindRequirements("Computer_Engineering");

            //Elective english1 = new Elective("English 1", 3);
            //english1.Courses.Add(new Course("EH00101", Course.AcademicStatus.NotYetTaken));

            //Elective english2 = new Elective("English 2", 3);
            //english1.Courses.Add(new Course("EH00102", Course.AcademicStatus.NotYetTaken));

            Elective upper = new Elective("CPE Electives", 9);

            upper.Courses = db.FindElectives("Computer_Engineering");

            List <Elective> humanities = new List <Elective>();

            humanities = db.FindSSElectives("Computer_Engineering");

            foreach (Elective elect in humanities)
            {
                ce.ElectiveCourses.Add(elect);
            }


            ce.ElectiveCourses.Add(upper);

            return(ce);
        }
Beispiel #2
0
        /// <summary>
        /// Used to determine if an elective will be taken
        /// </summary>
        /// <param name="elective"t>the elective to be checked</param>
        /// <returns>remaining hours to be taken</returns>
        public int ElectiveBeingTaken(Elective elective)
        {
            if (elective.Courses.Count == 0)
            {
                return(0);
            }
            Int64 hours = elective.Hours;

            //check every course that qualifies in the elective
            foreach (Course course in elective.Courses)
            {
                //and every semester
                foreach (Semester semester in this.Semesters)
                {
                    //and every course in these semesters
                    foreach (Course sCourse in semester.Courses)
                    {
                        if (sCourse.Name == course.Name && sCourse.Status != Course.AcademicStatus.Failed)
                        {
                            //keep a record of the total hours taken
                            hours -= course.Hours;
                        }
                    }
                }
            }
            //not found if hours > required hours
            return((int)hours);
        }
Beispiel #3
0
        public int AvailableElectiveHours(Elective elective, Degree degree)
        {
            Int64 result = 0;

            foreach (Course course in elective.Courses)
            {
                int temp = CourseIsTaken(degree, course);
                if (temp == NOTTAKEN && PossibleSemestersWithCoreqs(course, degree).Count > 0)
                {
                    result += course.Hours;
                }
            }

            return((int)result);
        }
Beispiel #4
0
        public List <Course> ElectivesNotTaken(Elective elective, Degree degree)
        {
            List <Course> result = new List <Course>();

            foreach (Course course in elective.Courses)
            {
                if (CourseIsTaken(degree, course) == NOTTAKEN)
                {
                    if (PossibleSemestersWithCoreqs(course, degree).Count > 0)
                    {
                        result.Add(course);
                    }
                }
            }

            return(result);
        }
Beispiel #5
0
        private bool ElectiveBeingTaken(Elective elective, Semester semester)
        {
            bool result = false;

            foreach (Course course in elective.Courses)
            {
                foreach (Course sCourse in semester.Courses)
                {
                    if (sCourse.Name == course.Name)
                    {
                        return(true);
                    }
                }
            }

            return(result);
        }
Beispiel #6
0
        static public Degree LoadOPE(DBClass db)
        {
            Degree ope = new Degree("OPE");

            ope.RequiredCourses = db.FindRequirements("Optical_Engineering");

            Elective upper = new Elective("OPE Electives", 3);

            upper.Courses = db.FindElectives("Optical_Engineering");

            List <Elective> humanities = new List <Elective>();

            humanities = db.FindSSElectives("Optical_Engineering");

            foreach (Elective elect in humanities)
            {
                ope.ElectiveCourses.Add(elect);
            }

            ope.ElectiveCourses.Add(upper);

            return(ope);
        }
Beispiel #7
0
        static public Degree LoadEE(DBClass db)
        {
            Degree ee = new Degree("EE");

            ee.RequiredCourses = db.FindRequirements("Electrical_Engineering");

            Elective upper = new Elective("CPE Electives", 9);

            upper.Courses = db.FindElectives("Electrical_Engineering");

            List <Elective> humanities = new List <Elective>();

            humanities = db.FindSSElectives("Electrical_Engineering");

            foreach (Elective elect in humanities)
            {
                ee.ElectiveCourses.Add(elect);
            }

            ee.ElectiveCourses.Add(upper);

            return(ee);
        }
Beispiel #8
0
        static public Degree LoadDegree(DBClass db, string degree)
        {
            Degree ce = new Degree("CE");

            degree             = degree.Replace(" ", "_");
            ce.RequiredCourses = db.FindRequirements(degree);

            Elective upper = new Elective(degree.Replace("_", " ") + "Electives", 6);

            upper.Courses = db.FindElectives(degree);

            List <Elective> humanities = new List <Elective>();

            humanities = db.FindSSElectives(degree);

            foreach (Elective elect in humanities)
            {
                ce.ElectiveCourses.Add(elect);
            }

            ce.ElectiveCourses.Add(upper);

            return(ce);
        }