國立暨南國際大學 99 學年度第一學期小考試卷

科目名稱:資訊系統 與網路導論 開課系所:資訊工程 學系 任課教師
吳坤熹
系所別:
年級:
學號:
姓名:
考試日期
2010.10.6

(考試時間: 16:30-16:45)

  1. (10%) Determine whether the following code is correct or not.  If it is correct, predict its output.  If it is incorrect, point out the mistake(s).
    LET I=1     ' This is equivalent to "I=1"
    WHILE I<=5
    PRINT I
    I=I+1
    WEND
    PRINT "==========="

    FOR I=1 TO 5
    PRINT I
    NEXT I
    END

  2. (10%) Determine whether the following code is correct or not.  If it is correct, predict its output.  If it is incorrect, point out the mistake(s).
    FOR I=1 TO 10 STEP 2
    PRINT I,
    NEXT I
    PRINT:PRINT I
    END

  3. (10%) Consider the following program.  Predict the relative position of the buttons, textbox, and labels in the opening window.

        'open a window with a button, a textbox, and a statictext
        'the window is sized at 300 by 100 at position 200, 150
        WindowWidth = 300   :    WindowHeight = 100
        UpperLeftX = 200    :    UpperLeftY = 150
        BUTTON #myFirst.ok, "OK!", [okClicked], UL, 220, 5
        BUTTON #myFirst.cancel, "Cancel", [quit], UL, 110, 5
        TEXTBOX #myFirst.field, 110, 35, 110, 25
        STATICTEXT #myFirst.label, "Type some text here.", 10, 35, 100, 25
        OPEN "myname's first window!" FOR WINDOW AS #myFirst
        'now stop and wait
        WAIT

    [okClicked]  'OK! was clicked.  Get the contents of the entry field
         'now get the contents from the textbox
        PRINT #myFirst.field, "!contents? aString$"
        'now pop up a notice saying what was in the textbox
        PRINT #myFirst.label, "StaticText"
        NOTICE UPPER$(aString$)

    [quit]
        'now close the window
        CLOSE #myFirst
        END