![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
2010年3月江蘇VB考試真題 |
絕密★ 啟用前 2010年春 江蘇省高等學(xué)校非計(jì)算機(jī)專業(yè)學(xué)生 計(jì)算機(jī)基礎(chǔ)知識(shí)和應(yīng)用能力等級(jí)考試 二級(jí)試卷 試卷語(yǔ)種:VB語(yǔ)言 說(shuō) 明: 1.本試卷包括計(jì)算機(jī)基礎(chǔ)知識(shí)部分和程序設(shè)計(jì)部分,考試時(shí)間共12 0分鐘; 2.本試卷滿分為60分,分選擇題和填空題,試卷不分A、B類型; 3.計(jì)算機(jī)基礎(chǔ)知識(shí)部分全部是選擇題(20分),程序設(shè)計(jì)部分分為選擇題(1 0 分)和填空題(30分)兩種; 4.選擇題用答題卡答題。每一項(xiàng)有A、B、C、D四個(gè)可供選擇的答案,請(qǐng)選 擇其中一個(gè)你認(rèn)為正確的答案,用HB鉛筆涂寫(xiě)在答題卡的相應(yīng)答題號(hào)內(nèi)。 每選對(duì)一項(xiàng)得1分,不選或選錯(cuò)不得分; 5.填空題用答題紙答題。請(qǐng)將答案用藍(lán)、黑色鋼筆或圓珠筆填寫(xiě)在答題紙的 相應(yīng)答題號(hào)內(nèi),每個(gè)答案只占一行,不得換行。每填對(duì)一個(gè)答案得1分, 不填或填錯(cuò)不得分; 6.請(qǐng)認(rèn)真填寫(xiě)并仔細(xì)核對(duì)答題卡和答題紙上的學(xué)校名稱、準(zhǔn)考證號(hào)和姓名是 否填寫(xiě)正確。 7.考試結(jié)束時(shí)將試卷、答題卡和答題紙放在桌上,不得帶走。待監(jiān)考人員收 畢清點(diǎn)后,方可離場(chǎng)。
一、選擇題(用答題卡答題,答案依次填在21—30答題號(hào)內(nèi)) 21.關(guān)于窗體,以下敘述中正確的是 21 。 A.僅當(dāng)窗體上沒(méi)有可以獲得焦點(diǎn)的控件時(shí),窗體才可以獲得焦點(diǎn) B.一個(gè)VB工程只能從某個(gè)指定的窗體開(kāi)始啟動(dòng) C.只有窗體可以作為控件的容器 D.Unload Me和End語(yǔ)句的效果總是等同的 22.若a為長(zhǎng)整型變量,則執(zhí)行a=12 : Print Len(a);Len(Str(a)); Len(CStr(a))后,在窗體上看到的是 22 。 A.4 2 3 B.2 3 23.數(shù)學(xué)表達(dá)式 A.Cos(30*3.14159/180)/(4*y+Ln(x))+Exp(2) B.Cos(30*3.14159/180)/(4*y+Log(x))+Exp(2) C.Cos(30*3.14159/180)/(4*y+Ln(x))+e^2 D.Cos(30)/(4*y+Log(x))+e^2 24.表達(dá)式Fix(-2.5)+Int(-3.5)+CInt(-2.5)的值是 24 。 A.-8 B. 25.以下說(shuō)法中,錯(cuò)誤的是 25 。 A.使用缺省Preserve關(guān)鍵字的ReDim語(yǔ)句可以改變數(shù)組的維數(shù)和大小 B.ReDim語(yǔ)句只能出現(xiàn)在過(guò)程中 c.使用ReDim語(yǔ)句重新定義的動(dòng)態(tài)數(shù)組,只能比原數(shù)組大 D.使用ReDim語(yǔ)句可以對(duì)動(dòng)態(tài)數(shù)組的所有元素進(jìn)行初始化 26.下列關(guān)于菜單的說(shuō)法中,錯(cuò)誤的是. 26 。 A.可以為菜單項(xiàng)選定快捷鍵 B.若在"標(biāo)題"文本框中鍵入連字符(一),則可在菜單的兩個(gè)菜單命令項(xiàng)之間加一條分隔線 C.除了Click事件之外,菜單項(xiàng)還可以響應(yīng)其他事件 D.菜單編輯器的"名稱"文本框用于輸入菜單項(xiàng)的名稱 27.以下有關(guān)過(guò)程中形式參數(shù)的描述中,錯(cuò)誤的是 27 。 A.函數(shù)過(guò)程可以沒(méi)有形式參數(shù) B.事件過(guò)程一定沒(méi)有形式參數(shù) C.形參數(shù)組只能按地址與實(shí)參數(shù)組結(jié)合 D.窗體與控件也可以作為過(guò)程的參數(shù) 28.以下表達(dá)式中,可以表示"A和B之一大于0"的是 28 。 ①A*B<=0 ②A>0 Xor B>0 ③A>0 Or B>0 ④A>0 And B<=0 Or B>0 And A<=0 A.①③ B.③④ C.②④ D.①②④ 29.設(shè)變量A為長(zhǎng)整型,則下面不能正常執(zhí)行的語(yǔ)句是 29 。 A.A=32768*2 B.A=2*1.5*16384 C.A=16384*2 D.A=190^2 30.以下有關(guān)滾動(dòng)條控件(ScrollBar)的說(shuō)法中錯(cuò)誤的是 30 。 A.只能在設(shè)計(jì)時(shí)設(shè)置Max與Min屬性值 B.Value屬性返回滾動(dòng)條內(nèi)滑塊當(dāng)前所處位置的值 C.拖動(dòng)滾動(dòng)條內(nèi)滑塊時(shí),將觸發(fā)滾動(dòng)條的Scroll事件 D.單擊滾動(dòng)箭頭時(shí),將觸發(fā)滾動(dòng)條的Change事件 二:填空題 1.執(zhí)行下面的程序后,A(1,4)的值是_____,A(2,3)的值是_______,A(3,2)的值是 Option Explicit Option Base 1 Private Sub Command1_Click() Dim a(4, 4) As Integer, ub As Integer Dim i As Integer, j As Integer, n As Integer ub = UBound(a, 1) n = 0 For i = ub To 1 Step -1 For j = 1 To ub + 1 - i n = n + 1 a(j, j + i - 1) = n Next j Next i For i = ub To 2 Step -1 For j = ub To i Step -1 a(j, j - i + 1) = a(5 - j, 4 - j + i) Next j Next i For i = 1 To ub For j = 1 To ub Picture1.Print a(i, j); Next j Picture1.Print Next i End Sub 2.在InputBox函數(shù)對(duì)話框中輸入4(或直接單擊”確定”按鈕)窗體顯示的第一行內(nèi)容__(4)___,第二行是__(5)___,第四行是__(6)___ Option Explicit private Sub command1_Click() dim days as integer Days=InputBox("輸入正整數(shù)",4) print fun(days) End Sub private function fun(d as integer) as integer if D=1 then fun=1 else fun=2*fun(D-1)+1 print D;fun end if End Function 3窗體顯示的第一行是__(7)_____第三行是__(8)_____最后一行是___(9)__ private sub command1_Click() Dim i as integer, k as integer For i=1 to 5 k=fun(i)+I print k next i print i End Sub Function Fun(N as integer) as Integer Static M as integer Dim j as integer M=M+N N=N+1 For J=1 To M J=J+2 Fun=Fun+J Next J Fun=Fun+N End Function 4.窗體顯示的第一行是__(10)_____第三行是__(11)_____,最后一行是_(12)____ Option Explicit Private Sub Command1_Click() Dim S as String,N as Integer S="3AB" N=14 Print Convert(S,N) End Sub Private Function Convert(S As string,N as Integer) as Long Dim St as string, L as Integer, I as integer L=Len(s) Do while L>=1 st=Left(s,1) if st>"9" then st=Asc(st)-55 end if Covert=Convert+Val(st)*N^(L-1) print Val(st)*N^(L-1) L=L-1 s=Right(S,L) End Function 5.窗體顯示的第一行是__(13)___,第二行是__(14)____,第三行是___(15)__ Option Explicit Private Sub Command1_Click() Dim s as string, k as integer, ch() as string Dim P as string,i as integer s=Ucase("Meet me after the class.") For i=1 to Len(s) If Mid(s,i,1)<="Z" and Mid(s,i,1)>="A" then p=p & Mid(s,i,1) ElseIf p<>"" then k=k+1 Redim Preserve ch(k) ch(k)=p p="" End if Next i For i=1 to Ubound(ch) if len(ch(i))<=2 then Call move_c(ch(i),1) else Call move_c(ch(i),2) end if print ch(i) next i End SUb Private Sub Move_c(s as string, k as integer) Dim i as integer, j as integer, p as string*1 For i=1 to k p=Right(s,1) For j=Len(s)-1 to 1 step -1 Mid(s,j+1,1)=Mid(s,j,1) Next j s=p & Right(s,Len(s)-1) next i End Sub 6.下面的程序是求的近似值,當(dāng)?shù)?/SPAN>n項(xiàng)的絕對(duì)值小于10^-5時(shí)終止計(jì)算 option explicit Private Sub Command1_Click() dim n as long, s as single, t as single, pi as single Const eps=0.00001 n=1 t=1 s=0 do s=s+t n=n+1 t=___(16)______ Loop Until __(17)______ pi=s*4 Label1.Caption ="的近似值為:" End Sub 7.下面程序的功能是,找出滿足以下條件的三位整數(shù),不含數(shù)字0, 且任意交換數(shù)字位置所得到的數(shù),均能被6整除 Option explicit Private sub Command1_Click() dim i as integer, j as integer, k as integer, st as string Dim a(6) as integer For i=100 to 999 if ______(18)_________ then For j=1 to 6 if a(j) Mod 6<>0 then Exit For Next j if______(19)________THen st=st & str(i) k=k+1 if k mod 3 =0 then st=st & vbcrlf End if End if Next I Text1=st End Sub Private Function fj(a() as integer, s as string) as Boolean Dim n as Integer, i as integer, j as integer if Instr(s,"0")<>0 then ___(20)___ end if For i=1 to 3 For j=1 to 2 n=n+1 ____(21)___ s=Left(s,1) & Right(s,1) & Mid(s,2,1) Next j s=Right(s,1) & left(s,2) Next i fj=True End Function 8.下面程序的功能是求兩個(gè)特大整數(shù)之和,由于vb中能夠表示的整數(shù)大小有一定限制,所以必須用新的方法求特大整數(shù)之和,本程序?qū)⑻卮笳麛?shù)使用字符類型進(jìn)行處理,其中函數(shù)add用于求兩個(gè)1位整數(shù)之和,參數(shù)c用于保存進(jìn)位,注意,求和前需首先將兩個(gè)整數(shù)按位對(duì)齊 option explicit private Sub command1_Click() Dim s1 as string, s2 as string, s3 as string dim i as integer, n1 as integer, n2 as integer dim c as integer, n as integer s1=text1 : s2=Text2 n=______22_____ if sgn(n)>0 then s2=________23__________ elseif Sgn(N)<0 then s1=String(Abs(n),"0") & s1 end if For i=len(s1) to 1 step -1 n1=Val(Mid(s1,i,1)) n2=Val(Mid(s2,i,1)) s3=_______(24)________ Next i if c<>0 then s3=________(25)________ Text3=s3 End Sub Private Function Add(x as integer, y as integer, c as Integer) as string Add=Cstr((x+y+c) Mod 10) _________(26)________ End Function 9. Option Explicit Private Sub Command1_Click() dim i as long,i2 as long, flag as Boolean Dim a(0 to 9) as integer, b(0 to 9) as integer For i=100000 to 160000 Call Validate(i,a,flag) if flag then i2=i*6 call Validate(i2,b,flag) if flag and Compare(a,b) then List1.AddItem i & " " & i2 End if End if Next i end sub Private Sub validate(n as long, a() as Integer, f as Boolean) dim p as integer, i as integer Erase a f=false for i=1 to len(cstr(N)) p=___(27)___ if a(p)=1 then exit sub else a(p)=1 end if next i ___(29) f=true End Sub Private Function Compare(a() as integer, b() as integer) as Boolean dim j as integer compare=false for j=1 to Ubound(a) if a(j)<>b(j) then ____(30)____exit function End if next j Compare=true End Function |