kl800.com省心范文网

信息技术学业水平测试VB套操作题复习及答案


VB操作一
Private Sub Command1_Click()

Dim h, m, s, ss As Integer
ss = Val(Text1.Text) h = ss \ 3600 m = (ss - h * 3600) \ 60 s = (ss - h * 3600) Mod 60 Label1.Caption = CStr(h) Label2.Caption = CStr(m) Label3.Caption = CStr(s) End Sub

VB操作一
Private Sub Command1_Click() Dim x As String, y As String Dim i As Integer Dim temp1 As String, temp2 As String x = Text1.Text y = "" For i = 1 To Len(Text1.Text) temp1 = Mid(x, i, 1) temp2 = 9 - temp1

y = y + temp2
Next i Text2.Text = y End Sub

VB操作一

Private Sub Command1_Click() Dim i As Integer, a As Integer, b As Integer, c As Integer

For i = 100 To 999
a = i \ 100 b = (i - a * 100) \ 10 c = i Mod 10 If a ^ 3 + b ^ 3 + c ^ 3 = i Then Print i Next i End sub

VB操作一

Private Sub Command1_Click() Dim s(9) As Single

For i = 0 To 9
s(i) = Val(InputBox("请输入一个数")) Next i For i = 9 To 0 Step -1 Print s(i) Next i End Sub

VB操作一

Private Sub Command1_Click()
Dim a, b, c, max As Integer a = Val(Text1.Text)

b = Val(Text2.Text)
c = Val(Text3.Text) If a > b Then max = a Else max = b

If c > max Then max = c
Label3.Caption = CStr(max) End Sub

VB操作二打不开

VB操作三

Private Sub Command1_Click() Dim s As Single Dim q As Single

Dim a As Single
Dim b As Single Dim c As Single a = Val(InputBox("请输入边长a的值:")) b = Val(InputBox("请输入边长b的值:")) c = Val(InputBox("请输入边长c的值:")) q = (a + b + c) / 2 s = Sqr(q * (q - a) * (q - b) * (q - c)) Print s End Sub

VB操作三

Private Sub Command1_Click() Dim year As Integer year = Val(InputBox("请输入年号:"))

If ((year Mod 4 = 0) And (year Mod 100 <> 0)) Or (year Mod 400 = 0) Then
Print "是闰年" Else Print "不是闰年" End If

End Sub

VB操作三

Private Sub Command1_Click() Dim a As Integer, b As Integer Dim bai As Integer, shi As Integer Dim g As Integer a = Val(Text1.Text) bai = a \ 100 shi = (a - bai * 100) \ 10 g = a Mod 10 b = g * 100 + shi * 10 + bai Text2.Text = CStr(b)

End Sub

VB操作三

Private Sub Command1_Click() Dim x As Single, y As Single a = 3: b = -5 x = Val(InputBox("请输入x的值"))

If x < 0 Then
y=x+5*a Else

y=x-2*b
End If Print "y="; CStr(y) End Sub

VB操作三
Private Sub Command1_Click() Dim a, b, c, p As Single

a = Val(Text1.Text)
b = Val(Text2.Text) c = Val(Text3.Text) p=b*b-4*a*c If p >= 0 Then X1 = (-b + Sqr(p)) / (2 * a) X2 = (-b - Sqr(p)) / (2 * a)

Print "X1="; X1
Print "X2="; X2

Else
Print "该方程无实数根" End If End Sub

VB操作四
Private Sub Command1_Click() Dim Wuyuan As Integer Dim Yiyuan As Integer Dim Wujiao As Integer For Wuyuan = 1 To 20 For Yiyuan = 1 To 100 Wujiao = 100 - Wuyuan - Yiyuan If Wuyuan * 5 + Yiyuan * 1 + Wujiao * 0.5 = 100 Then Print "Wuyuan=" & Wuyuan & ",Yiyuan=" & Yiyuan & ",Wujiao=" & Wujiao End If Next Yiyuan Next Wuyuan

End Sub

VB操作四

Private Sub Command1_Click()

Dim x As Single
Dim cost As Single x = Val(InputBox("请输入苹果公斤数:"))

If x <= 2 Then
cost = 6.8 * x Else cost = x * 6.8 * 0.8 End If Print cost End Sub

VB操作四
Public Function Fib(n As Integer) As Integer If (n = 1) Or (n = 2) Then Fib = 1 Else Fib = Fib(n - 1) + Fib(n - 2) End if End Function Private Sub Command1_Click()

Dim S As Integer
S = Fib(10) Print "S=" & CStr(S)

End Sub

VB操作四

Private Sub Command1_Click() Dim a, b, c As Integer Let a = Val(Text1.Text) Let b = Val(Text2.Text) Let c = Val(Text3.Text) If (a + b > c) And (a + c > b) And (b + c > a) Then

Let Text4.Text = "OK"
Else Let Text4.Text = "NO" End If End Sub

VB操作五
Private Sub Command1_Click() Dim i, a, b As Integer For i = 100 To 999 a = i \ 100

b = (i - a * 100) \ 10
c = i Mod 10 If a * a * a + b * b * b + c * c * c = i Then Print CStr(i) End If Next i End Sub

VB操作五

Private Sub Command1_Click() Dim h, x, y As Single Let x = Val(Text1.Text) Let h = Val(Text2.Text) Let y = x - (h / 100) * 0.5 Let Text3.Text = y End Sub

VB操作五

Private Sub Command1_Click() Dim a As Integer Dim b As Integer Dim t As Integer

a = Val(Text1.Text)
b = Val(Text2.Text) t=a

a=b
b=t Text1.Text = a Text2.Text = b End Sub

VB操作五

Private Sub Command1_Click()

Dim n, i As Long
Dim yes As Boolean Let n = Val(Text1.Text) Let yes = True For i = 2 To n \ 2 If n Mod i = 0 Then Let yes = False End If Next i If yes Then Let Text2.Text = "yes" Else Let Text2.Text = "no" End If End Sub

VB操作五

Private Sub Command1_Click() Const pi = 3.14

Dim r, s As Single
r = Val(T1.Text) s = pi * r * r T2.Text = s End Sub

VB操作六

Private Sub Command1_Click() Form1.Caption = Text1.Text End Sub

VB操作六

Private Sub Command1_Click() Dim a As Integer

a = Val(Text1.Text)
If a Mod 2 = 0 Then Label1.Caption = "偶数" Else Label1.Caption = "奇数" End If End Sub

VB操作六
Private Sub Form_Click() Dim i As Integer Dim j As Integer Print For i = -3 To 3 Print Tab(3);

For j = 1 To 3 - Abs(i)
Print "*"; Next

Print "*"
Next End Sub

VB操作六
Private Sub Command1_Click() Dim s As Single 's计算存款 Dim y As Integer 'y计算年份 Dim r As Single 'r是年利率 s = 1000 y=0 r = Val(InputBox("输入年利率", "数据输入框")) Do While s <= 2000 y=y+1

s = s * (1 + r)
Loop Print y; "年以后,存款可以达到2000元"

End Sub

VB操作六

倒推:

Private Sub Command1_Click() Dim tz As Integer 'tz是桃子数 Dim ts As Integer 'ts是天数 tz = 1 For ts = 1 To 9

第10天:1个 第9天:4个 第8天:10个 第7天:22个 。 。 第1天:? 设今天X个,剩下为Y个(明天)

tz = (tz+1)* 2
Next ts Print "最初共有桃子" & tz End Sub

那么Y=X-(1/2*X+1)=1/2*X-1
则X=(Y+1)*2

VB操作七

Private Sub Form_Load() Timer1.Interval = 1000 Label1.Caption = "" End Sub Private Sub Timer1_timer()

Label1.Caption = Time
End Sub

VB操作七

Private Sub Command1_Click() Dim x As Integer Dim s As Integer Dim i As Integer

For i = 1 To 10
x = Val(InputBox("NO." & i)) s=s+x

Print CStr(x)
Next i Print "total:" & s End Sub

VB操作七

Private Sub Command1_Click() Dim w As Integer 'w是行李重量 Dim pj As Integer 'pj是机票价格 Dim fy As Single w = Val(Text1.Text) pj = Val(Text2.Text) If w <= 20 Then fy = 0

Else
fy = (w - 20) * pj * 0.015 End If Text3.Text = fy End Sub

VB操作七
Private Sub Command1_Click() Dim x As Single x = Val(InputBox("请输入x的值!")) If x < 50 Then y = 0.8 * x Else

If x <= 100 Then
y = 0.7 * x Else Print "输入的数据出界!" End If End If Print x, y End Sub

VB操作七

Dim a(100) As Integer Private Sub Command1_Click() Dim total As Integer total = 0 For i = 1 To 100

If a(i) Mod 2 = 0 Then
total = total + 1 End If

Next i
Print CStr(total) End Sub Private Sub Form_Load() Randomize For i = 1 To 100 a(i) = Int(Rnd * 1000) Next i End Sub

VB操作八

Private Sub Command1_Click() Dim v As Single v = Val(InputBox("请输入飞船速度的值")) Select Case v Case Is > 16.67 Label1.Caption = "飞船挣脱太阳引力飞出太阳系" case is >=11.19 Label1.Caption = " 飞船离开地球的控制,围绕太阳转" case is >=7.91 Label1.Caption = "飞船绕地球似做匀速圆周运动" Case Else Label1.Caption = " 输入数据错误!" End select End Sub

Private Sub Command1_Click() Dim a(10) As Integer For i = 1 To 10 a(i) = Int(Rnd * 1000) Next i For i = 1 to 9 For j = i+1 to 10 If a(i) > a(j) Then a(0) = a(i) a(i) = a(j) a(j) =a(0) End If Next j Next i For i = 1 To 10 Print CStr(a(i)) Next i End Sub

Private Sub Command1_Click() Dim x As Integer, y As Integer x = Val(InputBox("请输入x的值:"))

If x>=0 Then
y=x Else

y= -x
End If Text1.Text = y End Sub

Private Sub Command1_Click()
Dim x As Long For x = 67008 To 67998 Step 10 If (x Mod 67 = 0) Or (x Mod 78 = 0) Then Print x End If next x End Sub

Private Sub Form1_Click() Dim tz As Single, sg As Single Dim bz As Single tz = Val(InputBox("请输入您的体重:")) sg = Val(InputBox("请输入您的体重:")) bz = tz / sg ^ 2 If bz > 25 Then MsgBox ("您的身材偏胖,需要加强锻炼!") Else If bz<18.5 Then MsgBox ("您的身材偏瘦,需要补充营养!") Else MsgBox ("您的身材真棒!") End If End If End Sub

VB操作九

Private Sub Command1_Click() x = Val(Text1.Text) If x Mod 3 = 2 Then If ① = 3 Then If ② Then Print ③ ① x mod 5 ② x mod 7=4 ③x

End If
End If End If

End Sub

Private Sub Form_Click()

Dim p As Integer Dim n As Long

'变量p保存人口


n=0 Do While ② p=p*③ n=④ Loop Print "n=" & CStr(n) End Sub ① p=14 ② p<=20 ③ (1+0.04) ④ n+1

Private Sub Command1_Click() Dim s As Integer Dim a As Integer Dim b As Integer Dim k As Integer s=0 a=1 b=1 For k = 1 To 10 s=s+a/b a=① s=② b=③ Next k Print s End Sub

① ② ③

a = a+b s = s+b/a b = a+b

Private Sub Command1_Click() Dim i As Integer Dim s As Integer i=1 s=0 Do While i <= 99 s=s+① i=② ①i ② i+2 ③s

Loop
Print "s=" & ③ End Sub

Private Sub Form_Click() Dim s As Integer Dim N As Integer N = 22 s=0 Do s=s+① N=② ①n ② n+20 ③ n-20

Loop Until s > 1500
Print "N=" & CStr(③) End Sub

VB操作十Private Sub Command1_Click()
Dim T As Single

Dim S1 As Single, S2 As Single Dim V1 As Single, V2 As Single

S1 = Val(InputBox("请输入王晓珊家离学校的距离:"))
V1 = Val(InputBox("请输入王晓珊步行速度:")) V2 = Val(InputBox("请输入李明步行速度:"))

T=①
S2 = ② * T Print ③ End Sub ① s1/v1 ② v2 ③ s2

Public Function Fac(a As Integer) As Integer If a = 1 Then Fac = ① Else Fac = a * ②(a - 1) End If End Function Private Sub Command1_Click() Dim S As Integer S = Fac(3) + Fac(③) + Fac(7) Print "S=" & CStr(S) End Sub ① 1 ② Fac ③ 5

Public Function S(n As Integer) As Integer If n = 1 Then S=① Else S = ② + S(n - 1) End If End Function
Private Sub Command1_Click() Dim Sum As Integer Sum = S(③) Print "Sum=" & CStr(Sum) End Sub

① 1 ② n ③ 100

Private Sub Command1_Click() Dim L As Integer Dim chang As Integer Dim kuai As Integer Dim s As Integer Dim smax As Integer smax = 0 L = InputBox("请输入一条铁丝的长度:") For chang = 1 To L \ 2 For kuai = 1 To L \ 2 - chang s=① If ② Then smax = s End If Next kuai Next chang Print ③ End Sub

① chang*kuai ② s>smax ③ smax

Private Sub Command1_Click() Dim H As Single, L As Single Dim S As Single, Home As Single Home = Val(InputBox("请输入一个起始高度:")) H = Home S=0 Do L = 0.7 * ① S=S+H+L H=② ①H Loop While L >= Home / 1000 ② L Print ③ ③ S End Sub

第11套不做,打不开

VB操作十二

Private Sub Command1_Click()

Dim t As Single '定义变量t,值由文本框Text1读入
t = Val(①) If ② Then Label1.Caption = "超重!不能参赛!" Else Label1.Caption = "合格,可以参赛!" ③ End Sub ① text1.text ② t>60 ③ Endif

Private Sub Command1_Click() Dim Cj As Single '定义变量Cj,值由文本框Text1读入 Cj = Val(①) If Cj ② 60 Then Label1.Caption = "不及格" End If If Cj >= 60 ③ Then Label1.Caption = "良好" End If ① text1.text If Cj >= 85 Then ② < Label1.Caption = "优秀" ③ And Cj <85 End If End Sub

Private Sub Form_Click() Dim s As Single ' s变量用于存放计算结果 Dim p As Single Dim i As Integer '定义一个循环变量 '给s赋初值 s=① '给p赋初值 p=② For i = 1 To 8 p=p*i s=③ Next i Print "s="; CStr(s) End Sub

①0 ② 1 ③ s+p

Private Sub Form_Click() Dim s As Integer Dim n As Integer n = ① ?为n赋初值 s=② '为s赋初值 ?变量s存放和

Do While s < 500

n=n+1
s=③ Loop

① 0 ② 0 ③ s+n

Text1.Text = CStr(n - 1)
End Sub

Private Sub Form_Click() Dim s As Integer '变量s存放和 Dim n As Integer s = ① ?为s赋初值 n = ② '为n赋初值 ① 0 ② 0 ③ <=500

Do
n=n+1 s=s+n

Loop While s ③ 500
Text1.Text = CStr(n) End Sub

VB操作十三

Private Sub Command1_Click() Dim a As Integer Dim i As Integer a=① For i = 1 To ② Step 1 ① ② ③ ④ 0 100 a+i a

a=③
Next i Text1.Text = CStr(④)

End Sub

Private Sub Command1_Click()
Dim a As Integer Dim i As Integer a=1 For i = 1 To ① Step 1 a=② Next i Text1.Text = CStr(③) End Sub ①7 ② a*i ③ a

Private Sub Form_Click() Dim s As Single Dim i As Integer s=① For i = 1 To ② Step 1 s=s+③ ① 0 ② 100 ③ 1/i '定义变量s为单精度型 '定义循环变量

Next i
Print "s="; CStr(s) End Sub

Private Sub Form_Click() Dim p As Single Dim n As Integer ① n=0 Do While p < 4000 p=p*② n=③ ① p=2000 ② (1+0.05) ③ n+1 ' 变量p保存年产值 ' 整型变量n为所求年数

Loop
Print "n="; CStr(n) End Sub

Private Sub Form_Click() Dim s As Single Dim i As Integer s=① For i = 1 To ② Step 1 If i Mod 2 <> 0 Then s=s+1/i Else

s=③
End If Next i Print "s="; CStr(s)

① 0 ② 100 ③ s=s-1/i

End Sub

VB操作十四

Private Sub Command1_Click() Dim i As Integer '定义i为整型变量

Dim j As Integer '定义j为整型变量 For i = 1 To 6 Step 1 For j = 1 To ① Step 1 Print ② ① i

Next ③
Print Next i End Sub

② “@”; ③ j

Private Sub Command1_Click() Dim a(9) As Integer Dim s As Single

Dim i As Integer
Me.Cls s=0 Randomize

For i = 0 To ① Step 1
a(i) = Int(Rnd * 100) Print a(i) ① 9 ② s+a(i) ③ Next i Next i For i = 0 To 9 s=② ③ Print "这10个自然数的平均值="; s / 10 End Sub

Private Sub Form_Click() Dim Ji As Integer Dim Tu As Integer Dim Leg As Integer For Ji = 1 To 40 'Ji变量表示鸡的个数 'Tu变量表示兔的个数 'Leg变量表示腿数

Tu = ①

'计算腿数
'如果腿正好100只,则打印。

Leg = ② + Tu * 4 If Leg = ③ Then

Print "鸡="; Ji; "只", "兔="; Tu; "只" End If Next Ji End Sub

① 40-ji ② ji*2 ③ 100

Private Sub Form_Click() Dim i As Integer Dim j As Integer For i = ① To 1 Step -1 For j = 1 To i Step 1 ② ① 4

Next j
Print ③ End Sub

② Print ”*” ; ③ Next i

Private Sub Command1_Click() Dim x, y As Integer

x = 10
y = 100 If x < y Then '以下三条语句交换x,y的值 t=① x=y y=② End If Text1.Text = ③ Text2.Text = CStr(y) End Sub ① x ② t ③ CStr(x)

VB操作十五
Private Sub Command1_Click() Dim i As Integer

Dim j As Integer
For i = 1 To ① Step 1 Print " "; For j = 1 To 9 Print ② Print vbTab; Next j ①9 Print ③ End Sub

② i*j; ③ Next i

① 9 ② a(i) ③ max

Private Sub Command1_Click() Dim a(9) As Integer Dim max As Integer Dim i As Integer Me.Cls Print Randomize For i = 0 To ① Step 1 a(i) = Int(Rnd * 100) Print a(i) Next i max = a(0) For i = 1 To 9 If max < a(i) Then max = ② End If Next i Print "这10个自然数中的最大值="; CStr(③) End Sub

Private Sub Command1_Click() Dim a As Single Dim b As Single '从Text1中读入这个数,并保存在变量a中 a = Val(①) b = a Mod ②

If b = 0 Then
Label1.Caption = "偶数" Else ① Text1.text ② 2 ③ Endif

Label1.Caption = "奇数"
③ End Sub


信息技术学业水平测试VB套操作题复习及答案.ppt

信息技术学业水平测试VB套操作题复习及答案_其它课程_高中教育_教育专区。江苏省信息技术学业水平测试VB套操作题复习及答案 VB操作一 Private Sub Command1_Click()...

高中信息技术学业水平测试 VB操作题.doc

高中信息技术学业水平测试 VB操作题 - Vb 算法 程序题汇总 目录 1、输入

2016年高中信息技术学业水平考试 VB程序复习题.doc

2016年高中信息技术学业水平考试 VB程序复习题_其它课程_高中教育_教育专区。直击考点,精准练习。信息技术学业水平考试 VB 专题复习试卷(一) 由陈顺贵老师整理 2016...

信息技术学业水平考试知识点VB.doc

信息技术学业水平考试知识点VB_计算机软件及应用_IT/计算机_专业资料。2016 年...流程图的有关知识 流程图是由一些图框和流程线组成,期中图框表示各种操作的类型...

2012年江苏高中信息技术学业水平测试vb操作题带答案.doc

2012年江苏高中信息技术学业水平测试vb操作题答案 - 徐州经济技术开发区高级中学 信息组 Vb专项练习第一套题目 1、打开“考生文件夹\96\工程1.vbp”,完善程序...

2012年江苏高中信息技术学业水平测试vb操作题带答案.doc

2012年江苏高中信息技术学业水平测试vb操作题答案 - 祝您考试成功! Vb专项练习第一套题目 1、打开“考生文件夹\96\工程1.vbp”,完善程序并保存。 实现功能:...

vb操作题考过的.doc

vb操作题考过的 - 江苏省信息技术学业水平测试... vb操作题考过的_其它课程_高中教育_教育专区。江苏省信息技术学业水平测试 VB 精选复习例题 Vb专项练习第一套题...

高中信息技术学业水平考试专题复习VB程序典型错误分析.doc

高中信息技术学业水平考试专题复习VB程序典型错误分析 - 高中会考专题复习Visual Basic 程序调试典型错误分析 VB 中常见的程序调试错误可分为编译错误、实时...

2016年浙江省信息技术学业水平考试VB知识点.doc

2016年浙江省信息技术学业水平考试VB知识点_其它课程_高中教育_教育专区。2016年...(动作) ,对象的行为是指对属性进行操作和处理的 方法(Method) ◆事件:事件(...

2014信息技术学业水平测试模拟试题(带答案及注解)_图文.doc

2014信息技术学业水平测试模拟试题(带答案及注解)_其它课程_高中教育_教育专区。...512× 512× 3× 8× 15 20、利用 VB 程序设计语言进行信息的编程加工的一般...

学业水平测试训练信息技术试题(附答案).doc

学业水平测试训练信息技术试题(附答案)_其它课程_高中教育_教育专区。2016信息...在 VB 中,要定义一个一维数组 a,用于存储 100 个整数型数值,则正确地数组...

高中信息技术学业水平测试复习题.doc

高中信息技术学业水平测试复习题_其它课程_高中教育_...人们把人造卫星发射上天,得到了大量的数据信息和情 ...48、()VB 是一种非常有名的文字处理软件。 49、...

09信息技术水平测试第一次模拟试题(vb).doc

09信息技术水平测试第一次模拟试题(vb)_工学_高等教育_教育专区。(vb) 省句中信息技术水平测试第一次模拟试题(算法与程序设计 省句中信息技术水平测试第一次...

信息技术学业水平测试新1-10操作题目.doc

信息技术学业水平测试新1-10操作题目 - 第一套 在 IIS 中,新建一虚拟目

2013山东信息技术学业水平考试真题1(VB).doc

2013山东信息技术学业水平考试真题1(VB) - 2013 信息技术学业水平测试(真题一) 一、单项选择题 1、下列行为最有可能导致信息安全问题的是( )。 A、安装正版杀毒...

信息学业水平测试套题.doc

2012年信息技术学业水平测试 第1 套题: 一、单...2、在 VB 中,变量名长度不能超过___个字符。 4...( ) A,具有相同的操作功能和相同的数据格式的对象...

江苏省普通高中信息技术学业水平测试讲解.doc

江苏省普通高中信息技术学业水平测试单机练习版(第一套 第二套 第三套) 第一...【第 27 题】打开"考生目录 VB\190\工程 1.vbp" 进行以下操作后并保存! 填空...

2014信息技术学业水平测试模拟试题(带答案及注解)汇总_....doc

2014信息技术学业水平测试模拟试题(带答案及注解)汇总 - 信息技术学业水平考试模拟试题 一、单项选择题 1、 如果从网上下载一个大于 300M 的软件,使用( C )方式...

2016高二学业水平信息技术含答案真题_图文.doc

2016 年高二学业水平考试复习册 高二信息技术 姓名:...下列属于数据库管理系统软件的是( ) A.VB B....第一套试题答案 1-10 CBDCB CDBCD 11-20 CBCBA...

2014江苏信息技术学业水平测试题 新增1 32有答案.pdf

2014江苏信息技术学业水平测试题 新增1 32有答案 - 1、黄胜买了一台计算