资源描述:
《VB期末考试复习题》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
VBὃ1ஹᦻ᪾⌱ᦻḄᑁḄឋOASelStartBSelLengthCSelTextDTextὃᫀC2ஹᙠᦻ᪾ᐸ"#$Textl,$%ᙠ&'()*◚,-ᦻ᪾./0ᵨḄ23$ATextl.Enabled=FalseBTextl.HideCTextl.ClearDTextl.Visible=FalseὃᫀD3ஹ4523Ifx=lTheny=l,6ᑡ89:;ḄAx=l=y=lᙳ$?@23Bx=l=y=lᙳ$ᐵB⊤DECx=l$?@23y=l$ᐵB⊤DEDx=l$ᐵB⊤DEy=l$?@23ὃᫀD4ஹF6GH"IJᔠVisualBasicḄL"MḄA_mnu_Open_234BAbc901Cprice_DKὃᫀA5ஹMsgBoxOᦪQR@ḄSToAᦪ@ᡈVJWBVJWCGDTᦪ@ὃᫀD6ஹVBᐳᨵ[\ஹ()=]^_`E⌕0ᵨbcᐹ.-Aeᐭ]`E
1Beᐭ()`ECeᐭ[\`EDIᵨeᐭgh`EὃᫀA7ஹ[a=6,ᑣ)x=IIF(a>5,-l,0)*xḄ@$A-1B6C0D5ὃᫀA8ஹkFlmᑤ◀VJpq=rstuḄOᦪAMidBRtrimCTrimDLtrimὃᫀC9ஹF623ḄvwxyPrintFormat$("32548.5","000,000.00")A32,548.5B32548.5C032,548.50D32,548.50ὃᫀC10ஹ[ᨵ6{|:DimXAsIntegerySgn(X)Ḅ@$-1,ᑣXḄ@A~50ḄᦪBᜧ50ḄᦪCᦪD50ḄᦪὃᫀD11ஹᙠLᢥᯠ*ᑏ6&:
2PrivateSubCommand1_C1ick()Fori=1To4x=4Forj=1To3x=3Fork=1To2x=x+6NextkNextjNextiPrintxEndSub&'()*ᓫLᢥvwxyoὃᫀ15#15#15#1512ஹ)6☢Ḅ&'*SḄ@$os=5Fori=2.6To4.9Step0.6s=s+lNextiὃᫀ913ஹ6ᑡ⊤DEᨵ┯:;Ḅᑏ9.-o[(a+b)+c]/80-5-(d+e)ὃᫀ(a+b+c)/80 5/(d+e)#(a+b+c)/80-5/(d+e)14ஹ⊤x5Ḅᦪᡈ9ḄᦪḄ⊤DE$ὃᫀxMod5=0OrxMod9=0#xMod9=0OrxMod5=015ஹF6&'Ḅ:vᐭᦪV/vᐭᦪmxvᐭ\wᦪVḄᙳ@vwxytPrivateSubForm_click()Dimx,yAsSingleDimzAsIntegerx=InputBox(MEnterascore0)Dowhilex>=0y=y+xz=z+1x=InputBox(nEnterascore11)LoopIfz=0Then
3z=1EndIfy=______PrintyEndSubὃᫀy/zVBὃ¡1ஹᑡ⊤᪾Ḅᑡ⊤⚗Ḅᦪ£kF¤F6¥ឋḄ@OAListindexBListCountCCountDIndexὃᫀB2ஹᙠ"#$ListlḄᑡ⊤᪾"#$Label1Ḅ᪗§ᑡ⊤᪾¨©ªḄ"#/ᓫᑡ⊤᪾Ḅ«©ª"mᙠ᪗§¨⌱©ªḄ"#6ᑡ:;¬®Ḅ&'oAPrivateSubListl_Click()Label1.Caption=List1.TextEndSubBPrivateSubListl_Click()Label1.Name=List1.ListindexEndSubCPrivateSubListl_Click()Label1.Name=List1.TextEndSubDPrivateSubListl_Click()Label1.Caption=List1.ListindexEndSubὃᫀA3ஹᙠᑡ⊤᪾/p⌱Ḅᑡ⊤⚗Ḅ'¯ᵫ6ᑡ¥ឋ⊤AListindexBIndexCListDTabindexὃᫀA4ஹ$%±◀ᑡ⊤᪾Ḅᡠᨵᑁ.0ᵨḄ³9
4AClearBRemoveCRemoveitemDCisὃᫀA5ஹᙠ"#$ListlḄᑡ⊤᪾$%4ᑡ⊤᪾Ḅ´⚗£µe)ᜐᳮ.0ᵨḄ¸¹23$oAFori=lToListl.ListCountNEXTBFori=0ToListl.Count-1NEXTCFori=0ToListl.ListCount-1NEXTDFori=lToListl.CountNEXTὃᫀC6ஹ[ᨵ6&'OptionBase0PrivateSubForm_Click()DimaDimiAsIntegera=Array(l,2,3,4,5,6,7,8,9)Fori=0To3Printa(5-i);NextEndSub&'()*ᓫᑣᙠ¨ḄOA6543B5432C4321D7654ὃᫀA7ஹ[)F6&'mº»vᐭ1ஹ3ஹ5,)xy$Dima(4)AsInteger,b(4)AsInteger
5ForK=0To2a(K+1)=Val(InputBox(”vᐭᦪ¼”))b(3 K)=a(K+1)NextKPHntb(K)A0B3C5D1ὃᫀD8ஹᙠ"#$Command1ḄLᢥᯠ*ᑏ6&':PrivateSubCommandl_Click()DimiAsInteger,jAsIntegerDima(10,l0)AsIntegerFori=lTo3Forj=lTo3a(ij)=(i-l)*3+jPrinta(i,j);NextjPrintNextiEndSub&'()*ᓫLᢥ¨ḄOA123456789B234345456C147258369D123246369ὃᫀA9ஹᵨ6☢Ḅ23ᡠ¿ÀḄᦪÁḄᐗÃᦪDimarr(3To5,-2to2)A24
6B12C15D20ὃᫀC10ஹ6ᑡ23kF$ÄᦪÁᑖǬ▭ᐗÃᦪAstatic23BDim23Cpublic23DReDim23ὃᫀD11 Ꮇ¿&'ᨵF623answer=MsgBox(,,Stringl,,„"String2",,,String3H,2))-23*ʨËÌ᪾Ímyᓫ“;¿“ᢥᑣanswei•Ḅ@$AString3BString2CString1D1ὃᫀD12ஹ[ᨵ23x=InputBox("vᐭᦪ@Ñ”)&'()*yvᐭᦪ@10ÒᢥRÓᑣ6ᑡÔ®:;ḄA0ÕÖ@BGHXḄ@VJW“10”CᙠInputBox4×᪾᪗⚪Ù¨Ḅ“Ñ”DGHXḄ@ᦪ@10ὃᫀB13ஹF6&'()ḄxyoDima(-lTo5)AsBooleanDimflagAsBooleanflag=FalseDimiAsIntegerDimjAsIntegerDoUntilflag=TrueFori=-1To5j=j+1Ifa(i)=FalseThen
7a(i)=TrueExitForEndIfIfi=5Thenflag=TrueEndIfNextLoopPrintjA20B7C8D35ὃᫀD14ஹ[a=5,b=6,c=7,d=8,ᑣ)6ᑡ23*xḄ@$x=IIF((a>b)And(c8FunctionFunc(ByValxAsInteger,yAsInteger)y=x*yIfy>0ThenFunc=xElseFunc=yEndIfEndFunctionPrivateSubCommandl_Click()DimaAsInteger,bAsIntegera=3b=4c=Func(a,b)Print"a="ÞaPrintHb=M;bPrint"c="ÞcEndSub&'()*ᓫLᢥᐸvwxy$Aa=3b=4c=12Ba=13b=12c=12Ca=3b=4c=3Da=3b=12c=3ὃᫀD⚪ᑖ63ஹᓫLᢥm6ᑡ&'ßṹḄ)xy$—PublicSubProcl(nAsInteger,ByVaimAsInteger)n=nMod10m=m/10EndSubPrivateSubCommand1_Click()DimxAsInteger,yAsIntegerx=12:y=34CallProcl(x,y)
9Printx;yEndSubA123B23C1234D234ὃᫀD⚪ᑖ64ஹF6ᐵ5Oᦪ&ḄÔ®:;ḄAᙠOᦪ&&ḄQR@kFᨵâBOᦪ&ãḄSTäOᦪQR@ḄSTåᨵᐵBC/ᦪÁæ$Oᦪ&ḄᦪmçFè@³Eè⌴êFèᙬ³Eè⌴DyIᢣ|Oᦪ&ᦪḄSTᑣ-ᦪåᨵᦪ¼STὃᫀB⚪ᑖ65ஹF689┯ḄAOᦪ&kFíᦪBî&åᨵQR@COᦪ&åᨵQR@Dî&kFíᦪὃᫀC⚪ᑖ66ஹᙠLᢥ("#$Command])ᯠ*ᑏ6&PrivateSubCommandl_Click()DimbAsIntegerb=b+1EndSub()&'^»ᓫLᢥ*GHbḄ@OA2B1C0D3ὃᫀB⚪ᑖ67ஹᎷ¿ᨵF6Oᦪ&FunctionFun(SAsString)AsStringDimsiAsStringFori=1ToLen(S)sl=UCase(Mid(S,i,l))+slNexti
10Fun=siEndFunctionᙠLᢥᯠ*ᑏ6&PrivateSubCommand1_Click()DimStrlAsString,Str2AsStringStrl=InputBox("vᐭVJW”)Str2=Fun(Strl)PrintStr2EndSub&'()*ᓫLᢥyᙠvᐭ4×᪾vᐭVJW"abcdefg”ᑣᓫ“;¿”ᢥ*ᙠḄvwxy$OAGFEDCBABABCEDFGCgfedcbaDabcdefgὃᫀA⚪ᑖ68ஹSub&äFunction&ᨬ᪷ḄðñAò_&ᦪḄè⌴³EIlBFunction&kFᨵᦪSub&IkFCSub&kF0ᵨCall23ᡈóô0ᵨ&"bᵨõFunction&IkFDSub&Ḅ&"IQR@õFunction&¤&"QR@ὃᫀD⚪ᑖ69ஹᙠßṹ¿À%î&SubP(a,b)EndSub6☢bᵨ-&ḄöE:;ḄACallPBCallP10,20CP(10,20)DCallP(10,20)ὃᫀD⚪ᑖ610ஹᙠ"#$CommandlḄLᢥᯠ*ᑏ6&'PrivateSubCommandl_Click()StaticXAsIntegerStaticYAsIntegerCisY=1
11Y=Y+5X=5+XPrintX,YEndSub&'()m^»ᓫLᢥCommandl*¨Ḅxy$A1515B156C1516D56ὃᫀB⚪ᑖ611ஹ[ᨵF6¸¹x᪀Do¸¹LoopWhilevᩩ,ᑣF6Ô®┯ḄOA¸¹kF0ᵨExitDo23B”ᩩ”kFᐵB⊤DEஹ⊤DEᡈúᦪC"ᩩ”$0Ḅúᦪᑣ»êI)¸¹Dy”ᩩ"û$True,ᑣIüᙢ)¸¹ὃᫀC⚪ᑖ612ஹᙠ"#$CommandlḄLᢥᯠ*ᑏ6¤ᵨ&=LᢥḄ&PrivateFunctionfun(ByValmAsInteger)IfmMod2=0Thenfun=2Elsefun=1EndIfEndFunctionPrivateSubCommand1_Click()DimiAsInteger,sAsIntegers=0Fori=1To5s=s+fun(i)NextPrintsEndSub&'()*ᓫLᢥᙠ¨A7B6
12C8D9ὃᫀ⚪ᑖ6AVBὃÿ1ஹᑏᵨᩭ10ᦪ(ᦪᐭ)ḄᨬᜧPrivateSubCommandl_Click()Dima(l0)AsInteger,maxAsIntegerFork=lTo10a(kInputBox("ᐭᦪ”)Nextkmax=0Fork=lTo10Ifa(k)>maxThenmax=a(k)EndIfNextkPrintmaxEndSub!"#$%&ᐭ10'ᦪ#()*ᑮ',-./ᐭ100ᦪ#-.1┯3Ḅ◤⌕6ᦋ☢Ḅ6ᦋ()*ᑮ',!"-.Ḅ1OA;max=a(k)ᦋmaxThenᦋ?@AFork=lTo10ᦋ13Form2.VisibleEndSubCPrivateSubCommand1_Click()LoadForm2EndSubDPrivateSubCommand1ClickForm2.ShowEndSubBὃDᫀD4ஹᙠijq|k14Listl.RemoveitemEndSubBὃDᫀc6ஹijqᨵkl15BAllFiles(*.*)CExecutableFiles(*.exe)D«,¬BὃDᫀC10 ᙠijq|kl