VB.Net 习题集参考答案
第一章 VB.NET环境和程序设计初步
一、CDABB AADBA BDCCA ADB
二、
(1)引入了.net 框架(2)可视化编成技术(3)解决方案(4)自动隐藏(5)视图、工具箱、可停靠 (6)工具、选项、项目(7)对象的性质,来描述和反映对象特征的参数(8)对象的动作、行为 (9)Form窗体、Font(10)按分类顺序、按字母顺序(11)FlatStyle 、System(12)项目、属性、常规 (13)SelectionStart(14)ReadOnly(15)TabIndex、0(16)全部保存
第二章 VB.NET语言基础和顺序结构
一、BCADB ADBBC DBCBA CACAD AD 二、
(1)整型、长整型、双精度型、货币型(2)(x mod 10)*10+x\\10
(3)Math.Sin(15*3.14/180) +Math.Sqrt(x+Math.Exp(3))/Math.Abs(x-y)-Math.Log(3*x) (4)(a+b)/(1/(c+5)-c*d/2)(5)x mod 5 =0 Or x mod 9 =0(6)False
(7)-4、3、-3、3、-4、4(8)CDEF(9)X >0 and y >0 Or x<0 and y<0(10)Now (11)DateDiff(“w”,Now,#6/30/2008#)(12)UCase(s) >= “A” and Ucase(s) <= “Z” (13)Rnd()*1000 + 100 、 ((x mod 100)\\10)*10
第三章
一、DCACA DAADA B 二、
(1) Mid(c,3,1) = “C”
选择结构
(2) 7
(3) 分别统计输入若干数的奇数和、偶数和,存放在m,n中
(4) e.KeyChar、e.KeyChar、count1-1、count1=0、“左括号多于右括号” & count1 & “个” (5) UCase(e.KeyChar)、C、“A”,”E”,”I”,”O”,”U”、Asc(c)=13 (6) x>20、x<10、Is>20、Is<10 (7) X+y>z and x+z>y and y+z>x
X=y and y=z
X=y Or y=z Or x=z
Msgbox(“是其他三角形”)
(8) d.year mod 4 = 0 and d.year mod 100 <> 0
d.year
第四章 循环结构
一、BCBCB 二、
(1) 33
(2) 10 (3) 4、12
(4) Len(a)、Int(n\\2)、Mid(a,n-I+1,1)、Mid(a,n-I+1,1)
(5) n mod 3 =1 and n mod 5 =1 and m mod 7 =1、while CountN < 5 (6) n mod 3=2 and n mod 4=3 and n mod 5=4 and n mod 6=5、Exit For
(7) X+1、X<>y and y<>z、n=n+1、Label1.Text &=
(8) Min1=mark、Min1=mark、Max1=mark、Aver=aver + mark、(aver-max1-min1)/5
第五章 数组
一、BBCDD
二、
(1) a(7)、a(j+1)=a(j)、a(1)=t、vbcrlf
(2) key=a(i)、a(j-1)=a(j)、Preserve a(Ubound(a)-1) (3) b(j,i)=n、n+5、a(i,k)*b(k,j)
(4) Preserve a(n+1)、a(i+1) = a(i)、a(I+1)=m、Ubound(a) (5) Tag = True、t = a(j)、a(j)=a(j+1)、Exit For (6) Chr(Int(Rnd()*26 +65))、n-1、GoTo Re、c
(7) Chr(Int(Rnd()*10 +65))、k=j、a(i)=a(k)、count+1、i+count
第六章 过 程
一、BDCDA DCB
二、
(1)1 4 4、用递归函数实现将十进制数以r进制显示 (2)6、用辗转相减法求m、n的最大公约数
(3)IsP=True、m mod i =0、p1 and p2、=p2
(4)Tag、c=a(0)、Ubound(a)-1、a(Ubound(a))=c、x=a(Ubound(a))、To 1 Step –1、a(0)=c (5)”数字” & Chr(i+48) & “出现次数为” & n(i)
ByRef num%(), ByVal s as String Mid(s,i,1) num(j)+1
(6)i , k , t
m*10+i mod 10 i\\10
True
(7) Mid(str1,1,j-1)、InStr(str1,”,”)、I (8)ByRef a%(), ByRef n as Integer
m>0 m to n n=n-1
m=m-1
(9)bb,Val(Textbox1.Text)
vbcrlf
j
第七章
一、 DCADC BDDAC BBDDD A 二、
(1) CheckState
(2) Enabled (3) 0
(4) Items.Count-1 (5) Clear
(6) 下拉式列表框 (7) Scroll
(8) LargeChange (9) Value (10) 15000
用户界面设计
(11) System.Diagnostics.Process.Start (12) LinkArea (13) &
(14) -(减号) (15) ContextMenu (16) ContextMenu (17) Hide
(18) Sub Main
(19) MouseButtons.Right (20) e.Shift
(21) i+1、ListBox1.Items.RemoveAt(j)
(22) True、e.Handled = True、CheckBox1.Checked、TextBox3.Focus()、TextBox4.Text=Total (23) Timer1.Enabled=True
M=Minute(Now)
Val(TextbOX1.text)=h and val(textbox2.text) = m (24) f2.show()
ShowDialog()
OpenFileDialog1.FileName PictureBox1.Left>Me.Width f2.TextBox2.Text = t
第八章 文 件
一、 CBADC AADBD ABC 二、 的
(1) FileOpen(1,”C:\\Stud.txt”,OpenMode.OutPut) e.KeyCode=Keys.Enter WriteLine(1,TextBox1.Text)
(2) OpenMode.Input
OpenMode.Output
Not EOF(1)
Str=LineInput(1)
FileClose()
(3) OpenMode.Append
OpenMode.Input Str=LineInput(2)
(4) OpenMode.Random
FileGet(1,s,5) S.mark=s.mark+5
FileGet(1,s,5)
(5) “教授”,“副教授”
Gz=Gz*1.0
WriteLine(2,No,Zc,Gz)
OpenMode.Output OpenMode.Input PrintLine(1,Str)
(6) OpenFileDialog1.FileName
Len(TextBox1.Text)
Asc(c)-Asc(“A”) Chr(i+Asc(“A”)
相关推荐: