國立暨南國際大學 103 學年度第二學期小考試卷

科目名稱:程式設計 開課系所:資訊工程 學系 考試日期 2015.6.10
系所別:
年級:
學號:
姓名:
考試時間 08:20-08:30
  1. (10%) If we replace the OnDraw() function in P.671 as below, what result will be shown on the screen after you run the program? Please specify the coordinates of endpoints of each segment, or the coordinates of centers and boundaries.
    void CSketcherView::OnDraw(CDC* pDC)
    {
        CSketcherDoc* pDoc = GetDocument();
        ASSERT_VALID(pDoc);
        if (!pDoc)
            return;

        pDC->Rectangle(150, 100, 200, 250);
        pDC->Rectangle(100, 150, 250, 200);
    }




  2. (10%) If we replace the OnDraw() function in P.671 as below, what result will be shown on the screen after you run the program? Please specify the coordinates of endpoints of each segment, or the coordinates of centers and boundaries.
    void CSketcherView::OnDraw(CDC* pDC)
    {
        CSketcherDoc* pDoc = GetDocument();
        ASSERT_VALID(pDoc);
        if (!pDoc)
            return;

        CBrush* pOldBrush = dynamic_cast<CBrush *>( pDC->SelectStockObject(NULL_BRUSH) ); // P.677
        pDC->Rectangle(150, 100, 200, 250);
        pDC->Rectangle(100, 150, 250, 200);
    }