139主题

BASIC:在窗体上画一个名称为Command1的命令按钮,编写如下程序: Private Sub Command1_Click() Print p1(3,7) ...

[单项选择题] - 考题描述:

在窗体上画一个名称为Command1的命令按钮,编写如下程序: Private Sub Command1_Click() Print p1(3,7) End Sub Public Function p1(x As Single,n As Integer) As Single If n=0 Then p1=1 Else If n Mod 2=1 Then p1=x*x+n Else p1=x*x-n End If End If End Function 程序运行后,单击该命令按钮,屏幕上显示的结果是( )。
A.2
B.1
C.0
D.16

现有程序如下: Option Base 1 Private Sub Form_Click() Dim x(5, 6)As Integer, y(5)As Integer For i = 1 To 5For j =1 To 6 x(i, j) = Int(Rnd * 9+1)Next j Next i Call f(5, 6, x, y) For i=1 To 5Print y(i); Next i End Sub Sub f(m As Integer, n As Integer, a()As Integer, b()As Integer) For i = 1 To mb(i) =0For j = 1 To nb(i) =b(i) +a(i, j)Next j Next i End Sub 关于上述程序,以下叙述中正确的是( )。Jackson结构化程序设计方法是英国的M. Jackson提出的,它是一种面向 【3】 的设计方法。对窗体编写如下事件过程: Private Sub Form_ MouseDown(Button As Integer,Shift As Integer,X As Single,Y As Single)If Button =2 Then Print “AAAAA”End If End Sub Private Sub Form_ MouseUp (Button As Integer,Shift As Integer,X As Single,Y As Single) Print “BBBBB” End Sub 程序运行后,如果单击鼠标右键,则输出结果为______ 。类是一个支持集成的抽象数据类型,而对象是类的 【3】 。在窗体上添加一命令按钮,其名为Command1,然后编写代码如下。 private Sub Command1_Click() Dim arr(5)As Integer,arr1(5)As Integern=3For i=1 To 5 an(i)=i arrl(n)=2*n+iNextPrint arr1(n);arr(n) End Sub 程序的运行结果为

参考答案:

D

相关题目