求VB试题 解答 ,十万火急
【程序1】请写出单击窗体后,窗体上的显示结果。OptionBase0PrivateSubForm_Click()DimaDimiAsIntegera=Array(1,2,...
【程序1】请写出单击窗体后,窗体上的显示结果。
Option Base 0
Private Sub Form_Click()
Dim a
Dim i As Integer
a=Array(1,2,3,4,5,6,7,8,9)
For i=0 To 3
Print a(5-i);
Next
End Sub
【程序2】请写出在Text1、Text2、Text3中依次输入2、3、4后,单击窗体时Label1的显示结果。
Private Sub Form_Click()
Dim a As Single, b As Single, c As Single
a = Text1.Text: b = Text2.Text: c = Text3.Text
Label1.Caption = Str(a * a + 2 * b * b + 3 * c * c)
End Sub
【程序3】请写出单击窗体后,窗体上的显示结果。
Private Sub Form_Click()
For I% = 1 To 3
Print Spc(3 - I%);
For J% = 1 To (2 * I%) - 1: Print "W";: Next J%
Print
Next I
End Sub
——————————————————————————
五、程序填空题
1.【程序说明】下面是一段计算数学表达式的程序。
Private Sub Form_Click()
Dim n As Integer, p As Integer, s As Single, q As Integer, i As Integer
n = InputBox("请输入N的值:")
s = 0
p = -1
q = (1)
For i = 1 To (2)
p = -p
q = (3)
s = (4) + p * i / q
(5)
Print s
End Sub
_______________________________________________
________________________________________________________
________________________________________________________
严肃声明,本人求解不是为了作弊! 展开
Option Base 0
Private Sub Form_Click()
Dim a
Dim i As Integer
a=Array(1,2,3,4,5,6,7,8,9)
For i=0 To 3
Print a(5-i);
Next
End Sub
【程序2】请写出在Text1、Text2、Text3中依次输入2、3、4后,单击窗体时Label1的显示结果。
Private Sub Form_Click()
Dim a As Single, b As Single, c As Single
a = Text1.Text: b = Text2.Text: c = Text3.Text
Label1.Caption = Str(a * a + 2 * b * b + 3 * c * c)
End Sub
【程序3】请写出单击窗体后,窗体上的显示结果。
Private Sub Form_Click()
For I% = 1 To 3
Print Spc(3 - I%);
For J% = 1 To (2 * I%) - 1: Print "W";: Next J%
Next I
End Sub
——————————————————————————
五、程序填空题
1.【程序说明】下面是一段计算数学表达式的程序。
Private Sub Form_Click()
Dim n As Integer, p As Integer, s As Single, q As Integer, i As Integer
n = InputBox("请输入N的值:")
s = 0
p = -1
q = (1)
For i = 1 To (2)
p = -p
q = (3)
s = (4) + p * i / q
(5)
Print s
End Sub
_______________________________________________
________________________________________________________
________________________________________________________
严肃声明,本人求解不是为了作弊! 展开
2个回答
展开全部
一、6 5 4 3
二、70
三、
W
WWW
WWWWW
五、
1.填空:
Private Sub Form_Click()
Dim n As Integer, p As Integer, s As Single, q As Integer, i As Integer
n = InputBox("请输入N的值:")
s = 0
p = -1
q = n
For i = 1 To n
p = -p
q = -q
s = s + p * i / q
next
Print s
……
End Sub
二、70
三、
W
WWW
WWWWW
五、
1.填空:
Private Sub Form_Click()
Dim n As Integer, p As Integer, s As Single, q As Integer, i As Integer
n = InputBox("请输入N的值:")
s = 0
p = -1
q = n
For i = 1 To n
p = -p
q = -q
s = s + p * i / q
next
Print s
……
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询