第1题:
在窗体中添加一个名称为Command1的命令按钮,然后编写如下程序: Public x As Integer Private Sub Command1_Click() x=10 Call s1 Call s2 MSgBox x End Sub Private Sub s1() x=x+20 End Sub Private Sub s2() Dim x As Integer x=X+20 End Sub 窗体打开运行后,单击命令按钮,则消息框的输出结果为______。
A.10
B.30
C.40
D.50
第2题:
下面程序的输出结果是。 Private Sub Commandl_Click ch$=“ABCDEF” proc ch:Print ch End Sub Private Sub proc(ch As Stnng) s=“” For k=Len(ch) TO 1 Step -1 s=s&Mid(ch,k,1) Next k ch=s End Sub A.ABCDEF B.FEDCBA C.A D.F
第3题:
A、Sub plus(sum, a , b ): sum = a + b: End Sub
B、Sub plus(ByVal sum , a , b ): sum = a + b: End Sub
C、Sub plus(sum , ByVal a, ByVal b ): sum = a + b: End Sub
D、Sub plus(sum , ByRef a , ByRef b ): sum = a + b: End Sub
第4题:
s=”this is the mainstring”,sub=”string”,strindex(s,sub)是()
第5题:
编写如下事件过程: Option Base 1 Private Sub Form Click() Dim x1()As Integer Dim i As Integer Dim s As Integer ReDim x1(3) For i = 1 To UBound(x1) x1(i)=i + 1 Next i Call sub1(x1) For i = 1 To UBound(x1) s = s + x1(i) Next i Print s End Sub Private Sub sub1(n()As Integer) Dim i As Integer ReDim Preserve n(5) For i = 3 To 5 n(i)=n(i-1)*2 Next i End Sub 程序运行后,单击窗体,则窗体上显示的内容是
A.6
B.12
C.24
D.47
第6题:
写出程序运行的结果
Public class Base
Public virtual string Hello() {return “Base”;}
Public class Sub:Base
Public override string Hello() {return “Sub”;}
1. Base b = new Base(); b.Hello;
2. Sub s = new Sub(); s.Hello;
3. Base b = new Sub (); b.Hello;
4. Sub s = new Base(); s.Hello;
第7题:
在窗体中添加一个名称为Commandl的命令按钮,然后编写如下程序: Public x As Integer Private Sub Commandl_click() x=10 Call s 1 Call s 2 MsgBOx x End Sub Pfivate Sub s1() x=x+20 End Sub Private Sub
A.10
B.30
C.40
D.50
第8题:
以下程序用于求S=1+3+32+33+…+310的值。
Private Sub Commandl_Click()
S=1
T=1
ForI=1 To 10
T=______
S=S+T
NextI
Print"S=";S
End Sub
第9题:
下列程序运行后的输出结果是______。
Private Sub f(k,s)
s=1
For j=1 To k
s=s*j
Next
End Sub
Private Sub Command1_Click()
Sum=0
For i=1 To 3
Call f(i,s)
Sum=Sum+s
Next
Print Sum
End Sub
第10题:
熟料中()含量增加时,则熟料易磨性好,易于粉磨。