【正文】
程序,當(dāng) 單擊 窗體 時(shí) ,窗體上 顯 示的第一行內(nèi)容是 _____,第三行內(nèi)容是 ______,第四行內(nèi)容是 ______。( 05年秋 29) ① Call Fun1(St(3)) ② Call Fun2(St) ③ Call Fun1(St) ④ Call Fun2(St(6) ) A.①② B.①③ C.②③ D.②④ 類(lèi) 型要匹配 江蘇省計(jì)算機(jī)等級(jí)考試二級(jí)VB 7 3.運(yùn)行下面的程序,當(dāng) 單擊 Command1時(shí) ,窗體上 顯 示的第一行內(nèi)容是 ____,第三行內(nèi)容是 ____,第四行內(nèi)容是 ___。 k End Sub Function fun(a As Integer, ByVal b As Integer) As Integer a = a + b b = a + b fun = a + b End Function 11 2 43 江蘇省計(jì)算機(jī)等級(jí)考試二級(jí)VB 6 29.程序中有兩個(gè) 過(guò) 程 Private Sub Fun1(S As String)和 Private Sub Fun2(a() As String*6),在 調(diào) 用 過(guò) 程中用 Dim St(6) As String*6定 義 了一個(gè)字符串?dāng)?shù) 組 。 j。 i。 ( 05春填空 2) Option Explicit Private Sub Command1_Click() Dim x As Single, i As Integer x = For i = 1 To 3 x = x * i Print fun1(x) Next i End Sub Private Function fun1(x As Single) As Single Static y As Single y = y + x fun1 = y / 2 End Function 江蘇省計(jì)算機(jī)等級(jí)考試二級(jí)VB 4 10 27 9 江蘇省計(jì)算機(jī)等級(jí)考試二級(jí)VB 5 ,單擊按鈕 Command1 ,窗體上顯示的結(jié)果中 I 的值是 _____ , J 的值是 ____, K 的值是 _____。歷 年 真題 解析(一) 江蘇省計(jì)算機(jī)等級(jí)考試二級(jí)VB 2 28.下面關(guān)于過(guò)程參數(shù)的說(shuō)法,錯(cuò)誤的是 ____________ 。 ( 05春 28) A.過(guò)程的形參不可以是定長(zhǎng)字符串類(lèi)型 B.形參是定長(zhǎng)字符串的數(shù)組,則對(duì)應(yīng)的實(shí)參必須是定長(zhǎng)字符串型數(shù)組,且長(zhǎng)度相同 C.若形參是按地址傳遞的參數(shù),形參和實(shí)參也能以按值傳遞方式進(jìn)行形實(shí)結(jié)合 D.按值傳遞參數(shù),形參和實(shí)參的類(lèi)型可以不同,只要相容即可 長(zhǎng) 度可以不同 江蘇省計(jì)算機(jī)等級(jí)考試二級(jí)VB 3 2.執(zhí)行下面的程序,單擊按鈕 Command1 ,在窗體上顯示的第一行是 ___ ,第二行是 ______ ,第三行是 _____ 。( 05春填空 4) Option Explicit Private Sub Command1_Click() Dim i As Integer, j As Integer Dim k As Integer i = 1: j = 2 k = fun(i, fun(i, j)) + i + j Print i=。 j=。 k=。下面 調(diào) 用語(yǔ) 句中正確的是。(05年秋填空 題 3) Private Sub Command1_Click() Print Test(3) End Sub Private Function Test(t As Integer) As Integer Dim i As Integer If t = 1 Then Call Test(t 1) For i = 3 To t Step 1 Print Chr(Asc(A) + i)。(05年秋填空 題 4) Dim x As Integer, y As Integer Private Sub Form_Click() Dim a As Integer, b As Integer a = 5: b = 3 Call sub1(a, b) Print a, b Print x, y End Sub Private Sub sub1(ByVal m As Integer, n As Integer) Dim y As Integer x = m + n: y = m n m = fun1(x, y) n = fun1(y, x) End Sub Private Function fun1(a As Integer, b As Integer) As Integer x = a + b: y = a b Print x, y fun1 = x + y End Function 10 8 5 2 12 10 江蘇省計(jì)算機(jī)等級(jí)考試二級(jí)VB 9 Sub子 過(guò) 程的各個(gè) 語(yǔ) 句中,正確的是_______(06年春 23) a. Private Sub Sub1(A() As string) b. Private Sub Sub1(A(1 to 10) As string*8) c. Private Sub Sub1(S As string) d. Private Sub Sub1(s As string*8) A abcd B abc C acd D ac 除非是形參數(shù) 組 ,否 則