예제 #1
0
    //题4:为course类实现一个CancelSection方法
    public void CancelSection(string day, string time, string room, int capacity)
    {
        Section s = new Section(OfferedAsSection.Count - 1,
                                day, time, this, room, capacity);

        OfferedAsSection.Remove(s);
    }
예제 #2
0
    //题4
    //实现一个CancelSection方法
    public void CancelSection(Section s)
    {
        //课程被移除
        OfferedAsSection.Remove(s);
        //选课项被移除
        s.OfferedIn.SectionsOffered.Remove(s.RepresentedCourse.CourseNumber +
                                           " - " + s.SectionNumber);

        Console.WriteLine("课程已经被移出选课表!");
    }
예제 #3
0
    //练习4
    public void CancelSection(Section s)
    {
        //该课程从选课列表中移除
        OfferedAsSection.Remove(s);
        //选课项从选课列表中移除
        s.OfferedIn.SectionsOffered.Remove(s.RepresentedCourse.CourseNumber +
                                           " - " + s.SectionNumber);

        Console.WriteLine("该课程已成功移出选课列表!");
    }
예제 #4
0
 //练习14.3:创建CancelSection方法
 public void CancelSection(Section s)
 {
     OfferedAsSection.Remove(s);
 }