vb编程考试题目
答:5 3 -1 2 0 1 7 2 5 2 0 -2 3 1 0 0 -4 -1 4 0 0 2 3 5 0 第1行交换第2行- 1 7 2 5 2 5 3 -1 2 0 0 -2 3 1 0 0 -4 -1 4 0 0 2 ...
答:Private Sub Command1_Click()For i = 1 To 5 Print Space(5 - i);For j = 1 To i - 1 Print "AB";Next j Print "A"Next i End Sub 问题2:先将第二个列表框的Sorted属性设为true Private Sub Command1_Click()For i = 0 To List1.ListCount - 1 List2.AddItem List1.List(...
答:1到100的和:Private Sub Form_Click()Sum = 0 Do i = i + 1 Sum = Sum + i Loop Until i = 100 Print Sum End Sub 判断成绩:Private Sub Command1_Click()If Text1 >= 90 Then MsgBox "优秀", vbOKOnly, "成绩"If Text1 >= 70 And Text1 < 90 Then MsgBox "良好", vbOKOn...
答:VB期末考试试题 一、 填空题1、VB程序设计的主要特点是 (1) 和 (2) 。2、在VB中,最主要的两种对象是 (3) 和 (4) 。3、工程是构成应用程序文件的 (5) 。4、方法是VB提供的一种 (6) ,用来完成一定的操作。5、浮点类型数据包括单精度型和___(7)__数据。6、事件是窗体或控件对象识别的___(8)_...
答:1、求和 Private Sub Form_Click()Dim rSum As Single Dim i As Integer For i = 1 To 100 If i Mod 2 = 0 Then '偶数 rSum = rSum - 1 / i Else '奇数 rSum = rSum + 1 / i End If Next Print rSum End Sub 2、素数函数 Private Function IsPrime(iNum As Integer) As ...
答:单项选择题 判断题 填空题 编程题 1) 下列程序运行后,输出的结果为___。 B=1 Do while (b<40) b=b*(b+1) Loop Print b a) 42 b) 39 c) 6 d) 1 答案:A 2) 设执行以下程序段时依次输入1、3、5,执行结果为___。 Dim a(4) As Integer Dim b(4) As Integer For K =0 To 2...
答:2.在VB应用程序之外删除工程中的一个文件时,不能更新此工程文件。(对)3.一个应用程序只能有一个mdi窗体。(错)4.在设计段通过用对话框控件的大小不能改变,用户也无法指定对话框在屏幕上的显示位置。(对)5.数据库中的健必须是唯一的。(对)五、简答题:从书上找,略 六、编程题:1.求1...
答:第一题:Private Sub Command1_Click()Dim I As Long For I = 100 To 1000 '输出100~1000之间的,如果不是这个区间,请自己更改 If I = SumNumber(I) Then Print I End If Next End Sub Function SumNumber(N As Long) As Long Dim S As String S = CStr(N)For I = 1 To Len(S...
答:第一题:楼上没考虑硬币总数是10枚哦 Private Sub Form_Click()Dim i%, j%, k%, n n = 0 For i = 0 To 10 For j = 0 To 10 - i For k = 0 To 10 - i - j If 1 * i + 2 * j + 5 * k = 25 And i + j + k = 10 Then Print "1元" & i & "枚", "...
答:第一题:计算函数:Private Function JS(n As Long, x As Double) As Double Dim mResult As Double Dim i As Long mResult = 0 For i = 0 To n - 1 mResult = mResult + ((-x) ^ i) / (i + 1)Next JS = mResult End Function 第二题:Private Sub Form_Click()Dim i ...
网友评论:
山的17624752607:
...范围内同时满足以下两个条件的十进制数. ⑴其个位数字与十位数字之和除以10所得的余数是百位数字;⑵该数是素数; 求有多少个这样的数? 2,编程计... -
35632傅爸
:[答案] 2. for i=10 to 500 step 2 sum=sum+i next i print sum 3. for i=200 to 1000 if i mod 3+i mod 5=0 then sum=sum+i next print sum 5. for i=1 to 3000 if i mod 17=0 or i mod 23=0 then j=j+1 next print j 6. for i=100 to 650 if i mod 3+i mod 7=0 then j=j+1 next print...
山的17624752607:
解答VB程序试题 -
35632傅爸
: ''1、将输入字符串“abcdef”输出为”fedcba” Private Sub Invert(ByVal xStr As String, yStr As String) Dim tempStr As String Dim I As Integer I = Len(xStr) Do While I >= 1 tempStr = tempStr + Mid(xStr, I, 1) I = I - 1 Loop yStr = tempStr End Sub ...
山的17624752607:
vb编程题 -
35632傅爸
: Private Sub Form_Load() Text1.PasswordChar = "*"End SubPrivate Sub Text1_KeyPress(KeyAscii As Integer) Static c As Integer If KeyAscii = 13 Then If Text1.Text = "...
山的17624752607:
VB编程题目
35632傅爸
: Dim j As Integer, t As Integer, m As Integer, n As Integer Dim s As Integer, i As Integer, k As Integer s = 1 m = InputBox("请输入m:") n = InputBox("请输入n:") Print "输入的两个数是:"; m; "和"; n If m > n Then i = m: m = n: n = ...
山的17624752607:
VB 程序编程题 -
35632傅爸
: Private Sub Command1_Click() n = CInt(Text1) For i = 1 To n s = s + i Next i Text2 = sEnd Sub...
山的17624752607:
(急)VB程序设计题目,请高手帮帮忙,谢谢! -
35632傅爸
: 弄个TIMER,然后设置1秒动1次,双击它,写picture1.left=picture1.left+1picture2.left=picture2.left-1if picture1.left+picture1.width>=picture2.left then mes...
山的17624752607:
vb编程的题目 -
35632傅爸
: '第一题:Option Explicit Private Sub Form_Click() Dim n(1 To 3) As Double, i As Integer, s As Double Do For i = 1 To 3 n(i) = Val(InputBox("请输入边长" & Chr(96 + i), "输入边长")) If n(i) = -1 Then Exit Sub Next If n(1) + n(2) > n(3) ...
山的17624752607:
vb程序设计试题 -
35632傅爸
: Option Explicit Dim PX As Single '中心坐标X Dim PY As Single '中心坐标Y Dim Rc As Single '轨道半径 Dim Rb As Single '小球半径 Dim Arg As Single ' 运转角度 Const Stp As Single = 3.14159 / 10 '运转速度 Private Sub Form_Load() Picture1....
山的17624752607:
vb考试编程题 -
35632傅爸
: 画面添加text1 text2 command1 Private scores(5) As String Private Sub Form_Load() scores(0) = 60 scores(1) = 70 scores(2) = 80 scores(3) = 90 scores(4) = 100 End Sub Private Sub Command1_Click() Dim i As Integer Dim iSum As Integer Dim...
山的17624752607:
vb题目2道 -
35632傅爸
: 1、Ax=5满足Not x < 0 ,所以x=y-3=-6-3=-9,所以y-x=-6-(-9)=3,x-y=-32、D 运行下程序就知道了,VB的格式输出标准是:如果输出的是数,输出时,数据前面会自动加上一个空格;分号的作用是去行,输出内容...