更多"有下列程序段,单击命令按钮执行程序后,输出结果为( )。 Optio"的相关试题:
[单项选择]有下列程序段,单击命令按钮执行程序后,输出结果为( )。
Option Base 1
Private Sub Command1_Click( )
Dim x
x=Array(23,-5,17,38,-31,46,11,8,5,-4)
s1=0
s2=0
For k=1 To 10
If(x(k)>0)Then
s1=s1+x(k)
Else
s2=s2+x(k)
End If
Next k
Y=s1/Abs(s2)
Print Y
End Sub
A. 148
B. 40
C. -40
D. 3.7
[单项选择]有下列程序段,单击命令按钮执行程序后,输出结果为( )。
Option Base 1
Private Sub Command1_Cliek( )
Dim x
x=Array(23, -5, 17, 38, -31, 46, 11, 8, 5, -4)
s1=0
s2=0
Fork=1 To 10
If (x(k)>0) Then
s1=s1+x(k)
Else
s2=s2+x(k)
End If
Next k
Y=s1/Abs(s2)
Print Y
End Sub
A. 148
B. 40
C. -40
D. 3.7
[单项选择]有下列程序段,单击命令按钮执行程序后,输出结果是( )。
Option Base 1
Private Sub Command1 Click( )
Dim x
x=Array(23,-5,17,38,-31,46,11,8,5,-4)
31=0
s2=0
For k=1 To 10
If(x(k)>0)Then
S1=S1+x(k)
Else
s2=s2+x(k)
End If
Next k
Y=s1/Abs(s2)
Print Y
End Sub
A. 148
B. 40
C. 40
D. 3.7
[单项选择]单击命令按钮时,下列程序段的执行结果为( )。
Private Sub Command1_Crick( )
Print Myfunc(24,18)
End Sub
Public Function MyFunc(m As Integer,n As Integer)As Integer
Do Whilem<>n
Do While m>n:m=m-n:Loop
Do While m<n:n=n-m:Loop
Loop
MyFunc=m
End Function
A. 2
B. 4
C. 6
D. 8
[单项选择]单击命令按钮时,下列程序段的执行结果为( )。
Private Sub Command1_Click( )
Dim a As Integer, b As Integer, c As Integer
a-2:b=4:c=6
Call S1(a, b)
Print "a="; a; "b="; b; "c="; c
Call S2(a, b)
Print "a ="; a; "b="; b; "c="; c;
End Sub
Private Sub S1(x As Integer, y As Integer)
Dim c As Integer
x=2*x:y=y+2:c=x+y
End Sub
Sub S2(x As Integer, ByVal y As Integer)
Dim e As Integer
x=2*x:y=y+2:e=x+y
End Sub
A. a=4 b=6 c=6
B. a=8 b=6 c=6
C. a=4 b=6 c=6
D. a=8 b=6 c=6
[单项选择]单击命令按钮时,下列程序段的执行结果为( )。
Public Sub Procl(n As Integer,ByVal m As Integer)
n=n Mod 10
m=m/10
End Sub
Private Sub Command1_Click( )
Dim x As Integer,y As Integer
x=12;y=34
Call Procl(x,y)
Print x;y
End Sub
A. 12 34
B. 2 34
C. 2 3
D. 12 3
[填空题]下面程序段实现单击命令按钮Command1时输出如下结果:
1 -1 -1
1 1 -1
1 1 1
该程序不完整,请填空。
Private Sub Command1_Click( )
Dim X(3,3)
For I=1 to 3
For J=1 To 3
If (14) Then
X(I,J)=1
End If
IfI<J Then
X(I,J)=-1
End If
Next J
Next I
For I=1 To 3
For J=1 To 3
Print X(I,J)
Next J
Print
Next I
End Sub
[填空题]下面程序段的作用:在窗体上一个命令按钮。单击命令按钮后,将程序中字符串 "Welcome Home"中的字符全部大写输出,其后字符"Wel Back"全部小写输出。请填空。
Private Sub Command1_Click( )
a = "Welcome Home";
b = "Wel Back"
c = 【8】 + LCase(b)
Print c
End Sub
[单项选择]单击命令按钮执行下列程序,其输出结果是( )。 Private Sub Command1_Click( ) Dim a As Integer, b As Integer, c As Integer a=3 b=4 c=5 Print SecProc(c,b,a) End Sub Function FirProc(x As Integer, y As Integer, z As Integer) FirProc=2*x+y+3*Z End Function Function SecProc(x As Integer,y As Integer, z As Integer) SecProc=FirProc(z,x,y)+x End Function
A. 20
B. 22
C. 28
D. 30
[单项选择]单击命令按钮执行以下程序,则输出结果为( )。
Private Sub Command1_Click( )
Dim x As Integer,y As Integer
X=14:y=48
Call Proc(x,y)
Print x;y
End Sub
Public Sub Proc(n As Integer,ByVal m As Integer)
n=n Mod 10:m=m Mod 10
End Sub
A. 4 8
B. 14 8
C. 14 48
D. 4 48
[单项选择]在窗体上画一个命令按钮,名称为Command1。单击命令按钮时,执行如下事件过程:
Private Sub Command1_Click( )
a$="software and hardware"
b$=Right(a$,8)
c$=Mid(a$,1,8)
MsgBox a$,,b$,c$,1
End Sub
则在弹出的信息框的标题栏中显示的信息是( )。
A. software and hardware
B. software
C. hardware
D. 1
[单项选择]在窗体上画一个命令按钮,名称为Command1。单击命令按钮时,执行如下事件过程:
Private Sub Command1_Click( )
a$="software and hardware"
b$=Right(a$,8)
c$=Mid(a$,1,8)
MsgBox aS,b$,c$,1
End Sub
则在弹出的信息框的标题栏中显示的信息是
A. software and hardware
B. software
C. hardware
D. 1