第1题:
下面子过程语句说明合法的是( )。
A.Function f1(By Valn%)
B.Sub f1(n%)As Integer
C.Function f1%(f1%)
D.Sub f1(ByValn%())
第2题:
(33)下列子过程语句的说明正确的是A.Sub f1(By Val x()As Integer) B.Sub f1(X%())As IntegerC.Function f1l%(f1%) D.Function f1%(x As Integer)
第3题:
A、Sub f1(ByVal n%())
B、 Sub f1(%)As integer
C、 Function f1%(f1%)
D、 Function f1(ByVal n%)
第4题:
现有如下程序: Private Sub Command1_Click() s=0 For i=1 To 5 s=s+f(5+i) Next Print s End Sub Public Function f(x As Integer) If x>=10 Then t=x+1 Else t=x+2 End If f=t End Function 运行程序,则窗体上显示的是( )。
A.38
B.49
C.61
D.70
第5题:
下面子过程语句说明合法的是
A.Sub f1(s1 As String*8)
B.Sub f1(n()As Integer)As Integer
C.Function f1(f1 As Integer)As Integer
D.Function f1(By Val n As Integer)
第6题:
使用VC6打开考生文件夹下的工程test8_1,此工程包含一个源程序文件test8_l.cpp,但该程序运行有问题,请改正程序中的错误,使程序的输出结果如下:
f1 function of derive
f2 function of base
f4 function of base
源程序文件test8_1.cpp清单如下;
include<iostream.h>
class base
{
public:
/*********found**********/
void f1(){cout<<"f1 function of base"<<endl;}
virtual void f2(){cout<<"f2 function of base"<<endl;)
virtual void f3(){cout<<"f3 function of base"<<endl;)
void f4(){cout<<"f4 function of base"<<endl;)
};
/*******+*found**********/
class derive::public base
{
void f1(){cout<<"f1 function of derive"<<endl;)
void f2(int X){cout<<"f2 function of derive"<<endl;)
void f4(){cout<<"f4 function of derive"<<endl;)
};
void main()
{
base *p;
derive obj2;
/******+**found**********/
p=obj2;
p->fl();
p->f2();
p->f4();
}
第7题:
在窗体上画一个命令按钮,其名称为Commandl,然后编写如下程序: Pfivate Sub Commandl_Click() Dima(10) As Integer Dimx As Integer Fori=1 To 10 a(i)=8+i NeXt X=2 Print a(f(x)+x) End Sub Function f(X As Integer) X=X+3 f=X End Fu
A.12
B.15
C.17
D.18
第8题:
设有一个命令按钮Command1的事件过程以及一个函数过程。程序如下: Private Sub Command1 Click( ) Static x A S Integer x=f(x+5) Cls Print X End Sub Private Function f(x As Integer)As Integer f=x+x End Function 连续单击命令按钮3次,第3次单击命令按钮后,窗体显示的计算结果是( )。
A.10
B.30
C.60
D.70
第9题:
在窗体上画一个名称为Text1的文本框,一个名称为Command1的命令按钮,然后编写如下事件过程和通用过程:
Private Sub Command1_Click()
n = Val(Text1.Text)
If n\2 = n/2 Then
f = f1(n)
Else
f = f2(n)
End If
Print f; n
End Sub
Public Function f1(ByRef x)
x=x*x
f1=x+x
End Function
Public Function f2(ByVal x)
x=x*x
f2=x+x+x
End Function
程序运行后,在文本框中输入6,然后单击命令按钮,窗体上显示的是( )。
A.72 36
B.108 36
C.72 6
D.108 6
第10题:
已知函数x(t)的傅里叶变换为X(f),则函数y(t)=2x(3t)的傅里叶变换为()
第11题:
Private Function f( x As String ) As Single
Private Function f( x As String )
Private Sub f( x As String ) As Single
Private Sub f( x As String )
第12题:
第13题:
下列子过程语句中正确的是 A.Sub f1(By Val()As Integer) B.Sub f1(n()As Integer)As Integer C.Function f1(f1 As Integer)As Integer D.Function f1(By Val f As Integer)
第14题:
在窗体上画一个命令按钮,命名为Command1。程序运行后,如果单击命令按钮,则显示一个输入对话框,在该对话框中输入一个整数,并用这个整数作为实参调用函数过程F1,在F1中判断所输入的整数是否是奇数,如果是奇数,过程F1返回1,否则F1返回1,否则返回0。能够正确实现上述功能的代码是 。A.Private Sub Command1_Click() x=InputBox("请输入整数") a=F1(Val(x)) Print a End Sub Function F1(ByRef b As Integer) If b Mod 2=0 Then Return 0 Else Return 1 End If End FunctionB.Private Sub Command1_Click() x=InputBox("请输入整数") a=F1(Val(x)) Print a End Sub Function F1(ByRef b As Integer) If b Mod 2=0 Then F1= 0 Else F1= 1 End If End FunctionC.Private Sub Command1_Click() x=InputBox("请输入整数") F1(Val(x)) Print a End Sub Function F1(ByRef b As Integer) If b Mod 2=0 Then F1= 1 Else F1= 0 End If End FunctionD.Private Sub Command1_Click() x=InputBox("请输入整数") F1(Val(x)) Print a End Sub Function F1(ByRef b As Integer) If b Mod 2=0 Then Return 0 Else Return 1 End If End Function
第15题:
设有如下程序: Private Static Function Fac(n As Integer)As Integer Dim f As Integer f=f+n Fac=f End Function Private Sub Form_Click( ) Dim I As Integer For 1=2 To 3 Print"#";I&“=”&Fac(1) Next I End Sub 程序运行后,单击窗体,在窗体上显示的是
A.#2=2 #3=3
B.#2=2 #3=5
C.#;2=2 #;3=3
D.#;2=2 #3;=5
第16题:
在窗体上画一个命令按钮,命名为CommandI。程序运行后,如果单击命令按钮,则显示一个输入对话框,在该对话框中输入一个整数,并用这个整数作为实参调用函数过程 F1,在F1中判断所输入的整数是否是奇数,如果是奇数,过程F1返回1,否则返回0。 能够正确实现上述功能的代码是
A.Privme Sub Command1_Click() x=InputBox(“请输入整数”) a=F1(Val(x)) Print a End Sub Function F1(ByRef b As Integer) If b Mod 2=0 Then Return 0 Else Return 1 End If End Function
B.Private Sub Command1_Click() x=InputBox(“请输入整数”) a=F1(Val(x)) Print a End Sub Function F1(ByRef b As Integer) If b Mod 2=0 Then F1=0 Else F1=1 End If End Function
C.Private Sub Command1_Click() x=InputBox(“请输入整数”) F1(Val(x)) Print a End Sub Function F1(ByRef b As Integer) If b Mod 2=0 Then F1=1 Else F1=0 End If End Function
D.Private Sub Command1_Click() x=InputBox(“请输入整数”) F1 (Val(x)) Print a End Sub Function F1(ByRef b As Integer) If b Mod 2=0 Then Return 0 Else Return 1 End If End Function
第17题:
设有一个命令按钮Command1的事件过程以及一个函数过程,程序如下:
Private Sub Command1_Click()
Static x as integer
X=f(x+5)
Cls
Print x
End Sub
Private function f(x as integer)as integer
F=x+x
End function
连续单击命令按钮3次,第3次单击命令按钮后,窗体上显示的计算结果是
A)10
B)30
C)60
D)70
第18题:
在窗体上画一个名称为Text1的文本框,一个名称为Command1的命令按钮,然后编写如下事件过程和通用过程: Private Sub Command1_Click() n = Val(Text1.Text) If n\2 = n/2 Then f = f1(n) Else f = f2(n) End If Print f; n End Sub Public Function f1(ByRef x) x=x*x f1=x+x End Function Public Function f2(ByVal x) x=x*x f2=x+x+x End Function 程序运行后,在文本框中输入6,然后单击命令按钮,窗体上显示的是
A.72 36
B.108 36
C.72 6
D.108 6
第19题:
下列子过程语句的说明正确的是( )。
A.Sub f1(ByVal x()As Integer)
B.Sub f1(x%())As Integer
C.Function f1%(f1%)
D.Function f1%(x As Integer)
第20题:
设有Function过程:
Private Function f(a As Integer, b As Integer) As Integer
a = a * a:
b = b * b
f = CInt(Sqr(a - b))
End Function
则如下程序段的运行结果是( )。
Private Sub Command1_Click()
Dim X As Integer, Y As Integer
X = 5: Y = 4
a = f(X, Y)
Print a
End Sub
A. 5
B. 4
C. 3
D. 9
第21题:
第22题:
已知列表x=[1,3,2],那么表达式[valu for index,value in enumerate(x)if index==2]的值为()。
第23题: