欢迎来到天天文库
浏览记录
ID:50853816
大小:90.00 KB
页数:26页
时间:2020-03-15
《VB课后习题答案汇总.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、课后习题参考答案第1章VisualBasic6.0一、判断题1--5:√×√×√6――10:××√×√11――13:√××二、选择题1――5:ADBBB6――10:.CACDB三、填空题1、图片框和框架2、对象3、控件屏幕4、Load5、LoadActivate四、程序设计题1、PrivateSubCommand1_Click()PrintText1.TextEndSubPrivateSubCommand2_Click()EndEndSub2、PrivateSubCommand1_Click()Form1.FontSize=Form1.FontSize+3Print"青春无悔"EndSubPr
2、ivateSubCommand2_Click()FontSize=FontSize-3Print"青春无悔"EndSubPrivateSubCommand3_Click()Form1.FontBold=TruePrint"青春无悔"EndSubPrivateSubCommand4_Click()FontBold=FalsePrint"青春无悔"EndSub3、PrivateSubCommand1_Click()Text1.Visible=FalseEndSubPrivateSubCommand2_Click()Text1.Visible=TrueText1.FontName="楷体_gb231
3、2"Text1.FontSize=15Text1.Text="我学会了创建一个应用程序了!"EndSub第二章判断题:1~5错错错错错第3章顺序结构程序设计一、思考题略二、程序阅读题1.A=2B=1C=22.123.BABCBACBC4.12False5.1-12-123-1234-三、选择题1.B2.D3.B4.B5.D6.C四、程序设计题1.Privatesubform_click()Dimr!,s!R=val(inputbox(“r=”))S=3.14159*r*rPrint“s=”;sEndsub2.Privatesubform_click() DimxassingleX=val(in
4、putbox(“x=”))Printfix(x*x*1000)/1000,fix(sqr(x)*1000)/1000Endsub第4章选择结构程序设计一、判断题1.错2.错3.错4.错5.对二、选择题1.A2.D3.A4.B5.A6.A三、程序阅读题1.X=3y=72.w=4w=13w=135w=313.X_`a12Uvw&4.129四、程序填空题1.(1)chr(keyascii)(2)chr(keyascii)=”)”(3)count1=count1-1(4)count1=0(5)count1>02.(1)max(2)min(3)c>max(4)c5、od5=3andxmod7=4then(2)text1.setfocus(3)text1.selstrat=0(4)text1.sellength=len(text1.text)五、1.PrivateSubCommand1_Click()DimyAsIntegery=Val(InputBox("y="))If(yMod4=0AndyMod100<>0)Or(yMod400=0)ThenPrint"是闰年"ElsePrint"不是闰年"EndIfEndSubPrivateSubCommand1_Click()DimyAsInteger,y1asstringy=Val(InputBox("y=")6、)If(yMod4=0AndyMod100<>0)Or(yMod400=0)ThenY1="是闰年"ElseY1="不是闰年"EndIf?y,y1EndSubPrivateSubCommand1_Click()DimyAsInteger,y1asstringy=Val(InputBox("y="))Y1="不是闰年"If(yMod4=0AndyMod100<>0)Or(yMod400=0)ThenY1="是闰年"EndIf?y,y1EndSub2.PrivateSubCommand1_Click()Dima%,b%,c%,x!,s!a=Val(InputBox("a="))b=Val(Inpu7、tBox("b="))c=Val(InputBox("c="))Ifa+b>cAnda+c>bAndb+c>aThenx=(a+b+c)/2s=Sqr(x*(x-a)*(x-b)*(x-c))Print"s=";sElsePrint"不是三角形,重输a,b,c"EndIfEndSubPrivateSubCommand1_Click()Dima%,b%,c%,x!,s!,t%a=Val(InputB
5、od5=3andxmod7=4then(2)text1.setfocus(3)text1.selstrat=0(4)text1.sellength=len(text1.text)五、1.PrivateSubCommand1_Click()DimyAsIntegery=Val(InputBox("y="))If(yMod4=0AndyMod100<>0)Or(yMod400=0)ThenPrint"是闰年"ElsePrint"不是闰年"EndIfEndSubPrivateSubCommand1_Click()DimyAsInteger,y1asstringy=Val(InputBox("y=")
6、)If(yMod4=0AndyMod100<>0)Or(yMod400=0)ThenY1="是闰年"ElseY1="不是闰年"EndIf?y,y1EndSubPrivateSubCommand1_Click()DimyAsInteger,y1asstringy=Val(InputBox("y="))Y1="不是闰年"If(yMod4=0AndyMod100<>0)Or(yMod400=0)ThenY1="是闰年"EndIf?y,y1EndSub2.PrivateSubCommand1_Click()Dima%,b%,c%,x!,s!a=Val(InputBox("a="))b=Val(Inpu
7、tBox("b="))c=Val(InputBox("c="))Ifa+b>cAnda+c>bAndb+c>aThenx=(a+b+c)/2s=Sqr(x*(x-a)*(x-b)*(x-c))Print"s=";sElsePrint"不是三角形,重输a,b,c"EndIfEndSubPrivateSubCommand1_Click()Dima%,b%,c%,x!,s!,t%a=Val(InputB
此文档下载收益归作者所有