国产最新a级毛片无码专区_综合亚洲欧美日韩久久精品_日本成年片在线观看66_一本到九九av电影_一级毛片免费网站播放_国内精品久久人无码大片_国产人成视频99在线观看_欧美不卡在线一本二本_国产亚洲电影av_可以免费看黄色软件

知ing

VB語(yǔ)言程序設(shè)計(jì)(第三版)

林卓然 編 / 電子工業(yè)出版社

邊治霏 上傳

查看本書(shū)

第9章習(xí)題


單選題

1.B     2.D     3.D           

4.B     5. A     6. A

編程及上機(jī)調(diào)試

1. 程序代碼如下:

Private Sub Form_load()

         Dim x(3) As Single, y As Single

         On Error GoTo errln                                '以后出錯(cuò)時(shí)轉(zhuǎn)移到errln

         y = 2 / 0                                          '產(chǎn)生"除數(shù)為0"的錯(cuò)誤

         x(4) = 1                                           '產(chǎn)生"下標(biāo)越界"的錯(cuò)誤

         MsgBox ("終止程序的運(yùn)行")

         Unload Me                                          '卸載窗體

         End

errln:                                                 '標(biāo)號(hào)

Select Case Err.Number

       Case 11                                         '"除數(shù)為0"的錯(cuò)誤碼為11

          MsgBox ("除數(shù)為0(錯(cuò)誤碼為11),跳過(guò)該錯(cuò)誤")

          Resume Next                                  '返回

       Case 9                                          '"下標(biāo)越界"的錯(cuò)誤碼為9

            MsgBox ("下標(biāo)越界(錯(cuò)誤碼為9),跳過(guò)該錯(cuò)誤")

            Resume Next                                '返回

       Case Else                         '其他錯(cuò)誤處理

            MsgBox ("錯(cuò)誤發(fā)生在" & Err.Source _

                & ", 代碼為" & Err.Number _

                & ", 即" & Err.Description)

    End Select

End Sub

2.改正后的程序代碼如下:

Private Sub Form_Load()

         Show

         For i = 1 To 11

             Print Tab(20 - i);

             For j = 1 To 2 * i - 1

                If j <= i Then

                   k = j

               Else

                  k = 2 * i - j

               End If

               If k > 9 Then k = k + 7

               Print Chr(k + 48);

            Next j

         Next i

End Sub

3.(1) n = n + 1          (2) d(1, j) = d(3, j)          (3) d(i, 2) = d(i, 4)

   (4) i = j Or i + j = 5                (5) d(i, j) = d(i, j) + 1

   (6) n = 0                             (7) Text1.Text


查看更多