单击命令按钮后,下列程序代码的执行结果是______。
Public Sub fun (a As Integer, b As Integer, c As Integer)
Do
a=b+ c
n=n+1
Loop While n > 3
End Sub
Private Sub command1_ click()
Dim m As Integer, n As Integer, i As Integer
For i = 0 To 2: m = n + 1: Next i
For i = 1 To 2: Call fun (m, n, i): Next i
For i = 0 To 3
Print m;
Next i
End Sub
第1题:
11、下面哪些定义是类型正确的?
A.f :: (Integer, Integer) -> Float f (x,y) = x / y
B.f :: (Integer, Integer) -> Float f (x,y) = (fromInteger x) / (fromInteger y)
C.f :: (Integer, Integer) -> Float f (x,y) = 3*x + y
D.f :: (Integer, Integer) -> Integer f (x, y) = 3*x + y
第2题:
8、下面哪些是将分数化为浮点数的正确定义?
A.type Fraction = (Integer, Integer) rateq :: Fraction -> Float rateq (a,b) = a/b###SXB###B.type Fraction = (Integer, Integer) rateq :: Fraction -> Float rateq (a,b) = (fromInteger a)/ (fromInteger b)###SXB###C.type Fraction = (Integer, Integer) rateq :: Fraction -> Float rateq (a,b) = fromInteger (a/b)###SXB###D.type Fraction = (Integer, Integer) rateq :: Fraction -> Float rateq (a,b) = (fromIntegral a)/ (fromIntegral b)###SXB###E.ty第3题:
阅读程序: Function F(a As-Integer) b=0 Static c b=b+1 c=c+1 F=a+b+c End Function Private Sub Command1_Click() Dim a As Integer a=2 For i=1 To 3 Prim F(A)Next i End Sub 运行上面的程序,单击命令按钮,输出结果为 ______。
A.4 4 4
B.4 5 6
C.4 6 8
D.4 7 9
第4题:
单击一次命令按钮之后,下列程序代码的执行结果为______。 Private Sub Command1_ Click() a = fun(4) + fun(5) Print a; End Sub Public Function fun (n As Integer) Static Num For i = 1 To n Num = Num + i Next i fun = Num End Function
A.15
B.20
C.35
D.40
第5题:
在窗体上添加一个命令按钮,然后编写其单击事件过程为:则单击命令按钮后消息框的输出结果是( )。
A. 7
B. 8
C. 9
D. 13
第6题:
在窗体上画—个命令按钮(名称为Command1),并编写如下代码:Function Fun1 (ByVala As Integer, b As Integer)As Integer Dim t As Integer t=a-b b=t+ a Fun 1=t+ bEnd FunctionPrivate Sub Command1_ Click() Dim x As Integer x=10 Print Fun1(Fun1 (x,(Fun1(x,x-1))),x-1)End Sub程序运行后,单击命令按钮,输出结果是 ______。
A.10
B.0
C.11
D.21
第7题:
若要在图3-19窗口(窗体名为frm001)中新增一个命令按钮,单击该命令按钮后,图像框所显示的图像就会成为此窗口的背景图像。请写出该命令按钮单击事件过程内的程序代码。
第8题:
A.type Integer intfunc (a Integer) Add(b Integer) Integer { return a + b}
B.type Integer intfunc (a Integer) Add(b *Integer) Integer { return a + *b}
C.type Integer intfunc (a *Integer) Add(b Integer) Integer { return *a + b}
D.type Integer intfunc (a *Integer) Add(b *Integer) Integer { return *a + *b}
第9题:
A.1,2
B.2,1
C.1,1
D.2, 2