您好,欢迎访问三七文档
当前位置:首页 > 高等教育 > 大学课件 > VisualBasic程序设计教程第三版课后习题答案
VBVisualBasic1VisualBasic____________________2VB____________________________________3__________ActiveX4VisualBasic6.0__________1VBABCD2ABCD3ABF4CCtrl+TD4ACtrl+DBCtrl+ECCtrl+FDCtrl+G5VisualBasicABCD1234VB56VB1Tab______________2__________________________________3setfocusvisible____________true4______________________5__________________6_______________7VB__________8VB_____________.BasBasic9VBDesign_____________Break1ChangeABCD2ABCD3VBABCD4ATEXTBCAPTIONCNAMEDFORECOLOR5ATEXTBCAPTIONCNAMEDFONT6TEXTLABEL1COMMAND1COMMAND1COMMAND10AINDEXBTABINDEXCTABSTOPDENABLED7TEXTTEXTACLICKBDBLCLICKCGOTFOCUSDCHANGE8TABATABSTOPTRUEBTABINDEXFALSECENABLEDTRUEDENABLEDFALSE9ATABINDEX0BTABSTOPTRUECTABSTOPFALSEDENABLEDFALSE10ABACKCOLORBBORDERSTYLECFORECOLORDBACKSTYLE11*AMULTILINETRUEBLOCKEDTRUECMULTILINEFALSEDLOCKEDFALSE12TEXT1APrivateSubText1_GotFocus()Text1.SelStart=0Text1.Sellength=Len(Text1.Text)EndSubBPrivateSubText1_LostFocus()Text1.SelStart=0Text1.Sellength=Len(Text1.Text)EndSubCPrivateSubText1_Change()Text1.SelStart=0Text1.Sellength=Len(Text1.Text)EndSubDPrivateSubText1_SetFocus()Text1.SelStart=0Text1.Sellength=Len(Text1.Text)EndSub13VisualBasicBasicABCD14LabelATextBNameCCaptionDAlignment15ATextBCaptionCNameD()16ABackColorBForecolorCFillColorDBackstyle17ClickTureAEnabledBValueCDefaultDCancel18ASelStartBSelLenghtCTextDSelText123456789101112VisuaBasic13VB1__________2______3______________________4VB__________________________________________________5OptionExplicit_____________________6functionaa(a1asdate,optionala2asboolean)assingleoptional__________________7VB______8________________________9commondialogactivex/filter=________________________10__________11Forj=3To20Step3______12Arraya()__________________________________13VisualBasic_________________1410Mod6\4______15chr(Asc(a)+5)_________16VB2________________17VB__________________18VB45DimJuzhen(__)asInteger19____20____21______________22ForNextFori=5To30Step2______23Mid(UniversityOfPetroleum,8,4)_________24__________25____________26__________27__________ActiveX28__________VB29True__________30__________________31____________32N1N2_________________33__________34__________35Dim__________36Abs(x)__________373/6*5__________1ArightBabc@123C123_abcDab123c2ABCD3MsgBoxALogBStrCLenDVal4DIMAA(3,4,5)A12B60C120D3455A$=CHINAB$=STRING$(3,A$)PRINTB$ENDACHIBCCCCINADAAA6PrintFormat$(32548.5,000,000.00)A32548.5B325,485.00C032,548,50D32,548,507AStaticStaticBSubSubCSubSubD8VisualBasicOnErrorResumenextA0BCD9VisualBasicAEndBExitDoCExitSubDDoEvents10VisualBasicABCD11Fori=1to3Forj=5to1Step1Printi*jNextj,iPrinti*jA15B.16C17D1812str1str2ALeftBMidCStringDInstr13TRUEA0B-1CTRUEDFALSE14ABCD15PRINTINT(-13.2)INT(-13.2)AINT(-13.2)=-13.2BINT(-13.2)=13.2CINT(-13.2)=-13DINT(-13.2)=-1416TAB1A0B1C2D317A0BC1D18Atxt1.text+txt2.text=txt3.textBcommand1.name=cmdokC12label.caption=1234Da=inputbox(hello19BOOLVARABOOLVAR=TRUEBBOOLVAR=.TRUECBOOLVAR=#TRUE#DBOOLVAR=3420XYAY=XX=YBZ=XY=ZX=YCZ=XX=YY=ZDZ=XW=YY=ZX=Y21PRINTSGN(-26)=SGN(-26)ASGN(-26)=26BSGN(-26)=-26CSGN(-26)=+1DSGN(-26)=-122Str2DimStr1,Str2asStringStr1=UniversityStr2=STRING$(3,Str1)AUniBUUUCityDyyy23VBStudentAsstringAsStringAsIntegerTypeAStudent.name=BDimsAsStudents.nameCDimsAsTypeStudentDDimsAsTypes.name=s.name=24Form1Form2mdlFuncForm1Form2mdlFuncForm1PrivateSubfrmfunction1()EndSubForm2PublicSubfrmfunction2()EndSubmdlFuncPublicSubmdlFunction()EndSubABmdlFunctionCfrmfunction1form1frmfunction2D25VBDoLoopDimi,nasIntegern=20i=1DoPrinti;i=i+2LoopUntili20A20B10C10D2026InputBoxAValBLenCStrDLog27VBAReDimBDimCPreserveReDimDErase28VBVBABCADODActiveX294+5\6*7/8Mod9A4B5C6D730ALtrimBRtrimCTrimDMid123Format4InputBox5MsgBox6789DimA(-3To5)AsInteger10VisualBasic5*x^2-3*x-2*Sin(a)/311)3)(2(byaxVB1223And4=5Or44131415161718192.75*2\3.4520GoTo1PrivateSubForm_Click()score=Int(Rnd*10)+80SelectCasescoreCaseIs60A$=FCase60To69A$=DCase70To79A$=CCase80To89A$=BCaseElseA$=AEndSelectPrintA$EndSub2Command1PrivateSubCommand1_Click()ForI=1To4ForJ=0ToIPrintChr$(65+I);NextJPrintNextIEndSub3Subinsert(a()AsSingle,ByValxAsSingle)Dimmasinteger,nasintegern=1DoWhilen20Andxa(n)n=n+1LoopForm=20-1TonStep1a(m+1)=a(m)Nextma(n)=xEndSub4SubsubP(b()AsInteger)Fori=1To4b(i)=2*iNextiEndSubPrivateSubCommandl_Click()Dima(1To4)AsIntegera(1)=5a(2)=6a(3)=7a(4)=8subPa()Fori=1To4Printa(i)NextiEndSub5Subsele()DimnasIntegeri=21:n=3DoWhileini=inLoopPrintiEndSub6SubselectPrint()DimaasIntegerDimbasIntegerDimcasIntegera=2:b=5:c=2If(a=b)and(a=c)or(bc)ThenPrintaa=a+2ElsePrintbEndIfPrinta;b;cEndSub7Subswap()DimxasIntegerDimyasIntegerDimzasIntegerx=1:y=2:z=0Printx;y;zx=x+yx=x*zPrintx,y,zEndSub8SubselectPrint()DimaasIntegerDimbasIntegerDimcasIntegera=3:b=3:c=2If(a=b)and(ac)ThenPrintaPrinta,b,cEndSub140040010042mnmnLable1Lable2Text1Text2Command1310090908080707060600error491656710100837133+73+13371921011ax2+bx+c=012nn!13Faibonacci01123581320201__________2VB________________________3__________4Form1_________________5___________________6Text1_____________________________7___________________8______________________9___________________
本文标题:VisualBasic程序设计教程第三版课后习题答案
链接地址:https://www.777doc.com/doc-8695453 .html