更多"设有如下通用过程: Public Function f(x A"的相关试题:
[单项选择]设有如下通用过程:
Public Function f(x As Integer)
Dim y As Integer
x=20
y=2
f=x*y
End Function
在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程:
Private Sub Command1_Click( )
Static x As Integer
x=10
y=5
y=f(x)
Print x;y
End Sub
程序运行后,如果单击命令按钮,则在窗体上显示的内容是
A. 10 5
B. 20 5
C. 20 40
D. 10 40
[单项选择]设有如下通用过程:
Public Function f(x As Integer)
Dim y As Integer
x=20
y=2
f=x*y
End Function
在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程:
Private Sub Command1_Click( )
Static x As Integer
x=10
y=5
y=f(x)
Print x;y
End Sub
程序运行后,如果单击命令按钮,则在窗体上显示的内容是( )。
A. 10 5
B. 20 5
C. 20 40
D. 10 40
[单项选择]设有如下通用过程:
Public Function Fun(xStr As String)As String
Dim tStr As String,strL As Integer
strL=Len(xStr)
Do While i<=strL/2
tStr=tStr&Mid(xStr,i,1)&Mid(xStr,strL-i+1,1)
i=i+1
Loop
在窗体上画一个名称为Text1的文本框和一个名称为Command1的命令按钮。然后编写如下的事件过程:
Private Sub Command1_Click( )
Dim S1 As String
Textl.Text=UCase(Fun(S1))
程序运行后,单击命令按钮,则Textl中显示的是【 】
A. ABCDEF
B. abcdef
C. AFBECD
D. DEFABC
[单项选择]设有如下通用过程:
Public Function Fun(xStr As String) As String
Dim tStr As String, strL As Integer
tStr=""
strL=Len(xStr)
i=1
Do While i<=strL/2
tStr=tStr & Mid(xStr,i,1) & Mid(xStr,strL-i+1,1)
i=i+1
Loop
Fun=tStr
End Function
在窗体上画一个名为Text1的文本框和一个名为Command1的命令按钮,并编写如下事件过程:
Private Sub Command1_Click( )
Dim S1 As String
S1="abcdef"
Text1.Text=UCase(Fun(S1))
End Sub
程序运行后,单击命令按钮,则Text1中显示的是
A. ABCDEF
B. abcdef
C. AFBECD
D. DEFABC
[单项选择]设有如下函数过程:
Function fun(a As Integer, b As Integer)
Dim c As Integer
If a<b Then
c=a:a=b:b=c
End If
c=0
Do
c=c+a
Loop Until c Mod b=0
fun=c
End Function
若调用函数fun时的实际参数都是自然数,则函数返回的是
A. a、b的最大公约数
B. a、b的最小公倍数
C. a除以b的余数
D. a除以b的商的整数部分
[单项选择]设有如下通用过程:
Public FunctionFun(x Str As String)As String
DimtStr As String,strL As Integer
tStr=""
strL=Len(xStr)
i=1
DoWhilei<=strL/2
tStr=tStr&Mid(xStr,i,1)&Mid(xStr,strL-i+1,1)"
i=i+1
Loop
Fun=tStr
End Function
在窗体上画一个名称为Text1的文本框和一个名称为Commandl的命令按钮。然后编写如下的事件过程:
Private Sub Commandl_Click( )
Dim S1 As String
S1="abcdef"
Text1.Text=UCase(Fun(S1))
End Sub
程序运行后,单击命令按钮,则Text1中显示的是( )。
A. ABCDEF
B. abcdef
C. AFBECD
D. DEFABC
[单项选择]设有如下通用过程:
Public Sub Fun(a( ),ByVal x As Integer)
For i=1 To 5
x=x+a(i)
Next
End Sub
在窗体上画一个名称为Text1的文本框和一个名称为Command1的命令按钮,然后编写如下的事件过程:
Private Sub Command1_Click( )
Dimsn(5)As Variant
For i=1 To 5
arc(i)=i
Next
n=10
Call Fun(arr( ),n)
Textl.Text=n
End Sub
程序运行后,单击命令按钮,则在文本框中显示的内容是
A. 10
B. 15
C. 25
D. 24
[填空题]设有如下通用过程:
Public Sub Fun(a( ),ByVal x As Integer)
For i=1 To 5
x=x+a(i)
Next
End Sub
在窗体上画一个名称为Text1的文本框和一个名称为Command1的命令按钮,然后编写如下的事件过程:
Private Sub Command1_Click( )
Dim arr(5)As variant
For i=1 To 5
arr(i)=i
Next
n=10
Call Fun(arr( ),n)
Text1.Text=n
End Sub
程序运行后,单击命令按钮,则在文本框中显示的内容是 【8】 。