窗体上有一个名称为Command1的命令按钮,其中部分代码如下:Private Sub Command1_Click()Dim a(10)As IntegerDim n As Integer……Call calc(a,n)……End Subcalc过程的首行应该是()。
A: Sub calc(x() As Integer, n As Integer)
B: Public Sub calc(x() As Integer)
C: Private Sub calc(a(n) As Integer, n As Integer)
D: Public Sub calc(a As Integer, n As Integer)
A: Sub calc(x() As Integer, n As Integer)
B: Public Sub calc(x() As Integer)
C: Private Sub calc(a(n) As Integer, n As Integer)
D: Public Sub calc(a As Integer, n As Integer)
举一反三
- 如下程序的运行结果是【1】. Private Sub Command1_Click() Dim x As Integer x = 12 f2 x Print x End Sub Public Sub f2(n As Integer) n = n Mod 10 End Sub
- 运行下面的程序,第二行显示结果是___________。 Private Sub Form_Click() Dim A As Integer Dim i As Integer A = 5 For i = 1 To 9 Call sub1(i, A) Print i, A Next i End Sub Private Sub sub1(x As Integer, y As Integer) Static N As Integer Dim I As Integer For I = 3 To 1 Step -1 N = N + x x = x + 2 Next I y = y + N End Sub
- 中国大学MOOC: 设有如下程序代码:Private Function Fc(ByVal n As Integer) As Integer Fc = n * Fj(5)End FunctionPrivate Function Fj(ByVal n As Integer) As Integer Fj = n + 3End FunctionPrivate Sub Command1_Click() Dim a As Integer a = 3 Form1.Print Fc(a)End Sub程序时单击命令按钮,在窗体上输出的结果为( )。
- 中国大学MOOC: 设有如下程序代码:Private Function Fc(ByVal n As Integer) As Integer Fc = n * Fj(5)End FunctionPrivate Function Fj(ByVal n As Integer) As Integer Fj = n + 3End FunctionPrivate Sub Command1_Click() Dim a As Integer a = 3 Form1.Print Fc(a)End Sub程序时单击命令按钮,在窗体上输出的结果为( )。
- 在窗体上画一个命令按钮Command1,编写事件代码如下: Public x As Integer Private Sub Command1_Click() x=3 Call f1 Call f2 MsgBox x End Sub Private Sub f1() x=x*x End Sub Private Sub f2() Dim x As Integer x=x+4 End Sub 运行窗体后,单击命令按钮,则消息框的输出结果为______。