在窗体上有一个命令按钮,然后编如下事件过程:
程序运行后,单击命令按钮,在输入对话框内输入-1,输出结果是 。
第1题:
在窗体上有一个命令按钮和一个文本框。编写如下事件过程:
Private Sub Command1_Click()
a=InputBox("请输入一个整数")
Text1.Text=a
If a > 0 Then
If a Mod 3 = 0 Then
MsgBox "True"
Else
MsgBox "error"
End If
End If
End Sub
程序运行后,单击命令按钮,在输入对话框里输入12,则弹出的提示内容是______。
第2题:
在窗体上画一个命令按钮,然后编写如下事件过程:
PrivateSubcommand1_click()
DimaAsString,bAsString
a=InputBox("EntertheFirstinteger")
b=InputBox("EntertheSecondinteger")
Printb+a
EndSub程序运行后,单击命令按钮,先后在两个输入对话框中分别输入456和111,则输出结果
是( )
A.456
B.111
C.567
D.111456
第3题:
在窗体上有一个命令按钮,其名称为Command1。要实现程序运行后,单击命令按钮,如果在输入对话框里分别输入12和4,编写如下事件过程:
Private Sub Command1_Click()
A=InputBox("被除数")
B=InputBox("除数")
Print A;"÷";B;"=";A / B
End Sub
则窗体中显示的内容是______。
第4题:
在窗体上画一个命令按钮,然后编写如下程序:
Dim k As Long
k=1
Do While num
Loop
fun=k
End Function
Private Sub Command1_Click()
Dim n As Long
Dim r As Long
MsgBox r
End Sub
程序运行后,单击命令按钮,在输入对话框中输入234,消息框显示的结果为( )。
第5题:
在窗体上画一个命令按钮,然后编写如下事件过程:
Private Sub Command1 Click()
a= Val(InputBox(“请输入一个整数”))
b=Val(InputBox(“请输入一个整数”))
Print a+b
End Sub
程序运行后,单击命令按钮,在输入对话框中分别输入12和34,输出结果为 ______。
第6题:
在窗体上有一个命令按钮,然后编写如下事件过程
Private Sub Commandl_cickc()
a=InputBox( "enter the first integer")
b=InputBox( "enter the second integer")
Print b + a
End Sub
程序运行后,单击命令按钮,先后在两个输入框中分别输入"2"和"6",则输出结果为( )。
A.2
B.62
C.8
D.26
第7题:
在窗体上画一个命令按钮,然后编写如下事件过程:
private sub command1_click()
dima,basinteger
a=Val(inputbox("EntertheFirstinteger"))
b=Val(inputbox("EntertheSecondinteger"))
Printb+a
end sub
程序运行后,单击命令按钮,先后在两个输入对话框中分别输入456和111,则输出结果是( )
A.456
B.111
C.567
D.111456
第8题:
在窗体上有一个命令按钮,然后编如下事件过程:
Function SR(x As Double) As Double
Select Case Sgn(x)
Case 1
SR=Sqr(x)
Exit Function
Case 0
SR=0
Case -1
SR=-1
End Select
End Function
Private Sub Command1_Click()
Dim Msg, SRN
Dim N As Double
N=InputBox("请输入要计算平方根的数")
Msg=N & "的平方根"
Select Case SR(N)
Case 0
Msg=Msg & "是0"
Case -1
Msg=Msg & "是一个虚数"
Case Else
Msg=Msg & "是" & SR(N)
End Select
MsgBox Msg
End Sub
程序运行后,单击命令按钮,在输入对话框内输入-1,输出结果是 【15】 。
第9题:
在窗体上画一个命令按钮,然后编写如下事件过程: Private Sub Command1_Click() a=InputBox("请输入一个整数") b=InputBox("请输入一个整数") Print a+b End Sub 程序运行后,单击命令按钮,在输入对话框中分别输入37和18,输出结果为
A.3718
B.55
C.0
D.a+b
第10题:
在窗体上有个命令按钮,然后编写如下事件过程 m=InputBox("enter the first integer") n=InputBox("enter the second integer") Print n+m 程序运行后,单击命令按钮,先后在两个输入框中分别输入“1”和“5”,则输出结果为
A.1
B.51
C.6
D.15