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

科目名稱:計算機概 論 開課系所:資訊工程 學系 考試日期 2013.10.1
系所別:
年級:
學號:
姓名:
考試時間 14:10-14:20
  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).
    # Output Formatting
    print('A', end='')
    print('A', end='')
    print('A')
    print('A')
    print('A')

  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).
    # Definite Loop
    for i in range(5):
        for j in range(i):
            print(i, end='')

    print()

  3. The following is the lyrics of "Stars" sung by Javert in Les Miserables. You may keep it for future reference.
    There, out in the darkness
    A fugitive running
    Fallen from God
    Fallen from grace
    God be my witness
    I never shall yield
    Till we come face to face
    Till we come face to face
    He knows his way in the dark
    Mine is the way of the Lord
    Those who follow the path of the righteous
    Shall have their reward
    And if they fall
    As Lucifer fell
    The flame
    The sword!
    Stars
    In your multitudes
    Scarce to be counted
    Filling the darkness
    With order and light
    You are the sentinels
    Silent and sure
    Keeping watch in the night
    Keeping watch in the night
    You know your place in the sky
    You hold your course and your aim
    And each in your season
    Returns and returns
    And is always the same
    And if you fall as Lucifer fell
    You fall in flame!
    And so it must be and so it is written
    On the doorway to paradise
    That those who falter and those who fall
    Must pay the price!
    Lord let me find him
    That I may see him
    Safe behind bars
    I will never rest
    Till then
    This I swear
    This I swear by the stars!
    GAVROCHE
    That inspector thinks he's something
    But it's me who runs this town!
    And my theater never closes
    And the curtain's never down
    Trust Gavroche, have no fear
    Don't you worry, auntie dear,
    You can always find me here!