信息技术学业水平测试vb套操作题复习及复习资料

上传人:第*** 文档编号:119349839 上传时间:2020-01-13 格式:PPT 页数:62 大小:1.61MB
返回 下载 相关 举报
信息技术学业水平测试vb套操作题复习及复习资料_第1页
第1页 / 共62页
信息技术学业水平测试vb套操作题复习及复习资料_第2页
第2页 / 共62页
信息技术学业水平测试vb套操作题复习及复习资料_第3页
第3页 / 共62页
信息技术学业水平测试vb套操作题复习及复习资料_第4页
第4页 / 共62页
信息技术学业水平测试vb套操作题复习及复习资料_第5页
第5页 / 共62页
点击查看更多>>
资源描述

《信息技术学业水平测试vb套操作题复习及复习资料》由会员分享,可在线阅读,更多相关《信息技术学业水平测试vb套操作题复习及复习资料(62页珍藏版)》请在金锄头文库上搜索。

1、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 Integ

2、er 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

3、 - 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 = V

4、al(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 =

5、 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

6、 不是闰年 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(

7、) Dim x As Single, y As Single a = 3: b = -5 x = Val(InputBox(请输入x的值) If x = 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 Integ

8、er 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= 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

9、是年利率 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 tz = (tz+1)* 2 Next ts Print 最初共有桃子 CStr(s) End Sub 0 1 s+p

10、Private Sub Form_Click() Dim s As Integer 变量s存放和 Dim n As Integer n = 为n赋初值 s = 为s赋初值 Do While s 500 n = n + 1 s = Loop Text1.Text = CStr(n - 1) End Sub 0 0 s+n 0 0 =500 Private Sub Form_Click() Dim s As Integer 变量s存放和 Dim n As Integer s = 为s赋初值 n = 为n赋初值 Do n = n + 1 s = s + n Loop While s 500 Text

11、1.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 a = Next i Text1.Text = CStr() End Sub 0 100 a+i a 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

12、a*i a Private Sub Form_Click() Dim s As Single 定义变量s为单精度型 Dim i As Integer 定义循环变量 s = For i = 1 To Step 1 s = s + Next i Print s=; CStr(s) End Sub 0 100 1/i Private Sub Form_Click() Dim p As Single 变量p保存年产值 Dim n As Integer 整型变量n为所求年数 n = 0 Do While p 4000 p = p * n = Loop Print n=; CStr(n) End Sub

13、p=2000 (1+0.05) n+1 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) End Sub 0 100 s = s - 1 / i VB操作十四 Private Sub Command1_Click() Dim i As Integer 定义i为整型变量 Dim j As Integer 定义j为整型变量 For i = 1

14、 To 6 Step 1 For j = 1 To Step 1 Print Next Print Next i End Sub i “”; 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) Next i For i = 0 To 9 s = Print 这10个自然数的平均值=; s / 10 End Sub 9 s+a(i) Next i Private Sub Form_Click() Dim Ji As

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 资格认证/考试 > 自考

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号