单选题下列程序段的显示结果为 ______。 x=0 Print
x-1 x=3
A. -1
B. 3
C. 2
D. 0
单选题以下过程定义中正确的过程首行是______。
A.Private Sub Proc(Optional a as Integer, b as Integer)
B.Private Sub Proc(a as Integer)as Integer
C.Private Sub Proc(a()As Integer)
D.Private Sub Proc(ByVal a()As Integer)
单选题在新建一个VB工程时,将新建窗体的Name属性设置为TheFirst,则默认的窗体文件名为( )。
单选题设有如下程序段: x=2 For i=1 To 10 Step
2 x=x+i Next
运行以下程序后,x的值是{{U}} {{/U}}。
A.26
B.27
C.38
D.57
单选题编写如下程序: Option Base1 Private Sub Command1_Click() Dim a a=Array(1,2,3,4):s=0:j=1 For i=4 To 1 Step-1 s=s+a(i)*j:j=j*10 Next i Print s End Sub 程序运行后,单击命令按钮Command1,输出结果为
单选题设a=“a”,b=“b”,c=“c”,d=“d”,执行语句x=Ilf((a<b)Or(c>d),“A”,“B”)后,x的值为
单选题设a=5,b=6,c=7,d=8,执行下列语句后,x的值为 X=IIF((a>b) And (c>d),10,20)
单选题假定在工程文件中有一个标准模块,其中定义了如下记录类型 Type Books
NalTle As String*10 TelNum As
String*20 End Type
要求当执行事件过程ComlBandl_Click时,在顺序文件Person.txt中写入一条记录。下列能够完成该操作的事件过程是{{U}}
{{/U}}。
A.Ptivate Sub Commandl_Click() DimB As Books
Open"c:/Person.txt"For Output As#1
B.Name=InputBox(“输入姓名”) B.TelNum=InputBox(“输入电话号码”)
Whte#1,B.Name,B.TelNum Close#1
End Sub B.Private Sub Commandl_Crick() DimB As
Books Open"C:/Person.txt"ForInput As#1
B.Name=InputBox(“输入姓名”)
B.TelNum=InputBox(“输入电话号码”)
Prin(#1,B.Name,B.Te1Num Close#1 End Sub
C.Private Sub Conullandl_CHCk() DimBAs Books
Open"c:/Person.txt"For Ouputut As#1
Name=hputBox(“输入姓名”) Temum=InputBox(“输入电话号码”)
Whte#1,B Close#1 End Sub
D.Privam Sub Commnandl_Click() DimBAsBook
Open"C:/Person.txt"For Input As#1
Name=InputBox(“输入姓名”) TelNum=InputBox(“输入电话号码”)
Print #1,B.Name,B.TelNum Close#1
End Sub
单选题在窗体上画—个名称为Text1的文本框,并编写如下程序: Private Sub
Form_Load() Show Text1.Text="
" Text1.SetFocus End Sub
Private Sub Form_MouseUp(Button As Integer,Shift As Integer,X As Single,Y
As Single) Print "程序设计" End
Sub Private Sub Text1_KeyDown(KeyCode As Integer,Shift As
Integer) Print "Visual Basic"; End
Sub 程序运行后,如果按A键,然后单击窗体,则窗体上显示的内容是 ______。
A. Visual Basic
B. 程序设计
C. A程序设计
D. Visual Basic程序设计
单选题设有如下Commandl的单击事件过程及fun过程: Private Sub Commandl一Click() Dim x As Integer x=Val(InputBox(“请输入一个整数”)) fun(x) End Sub Private Sub fun(x As Integer) If x Mod 2=0 Then fun(x/2) Print x; End Sub执行上述程序,输入6,结果是( )。
单选题用下面的语句
Open"datafile.dat" Access Read Write As 1
所建立的datafile.dat文件是
单选题在窗体上画一个命令按钮,然后编写如下事件过程: Private Sub Command1_Click() A="12" B="34" C="56" Print A+B+C End Sub 程序运行后,单击命令按钮,输出结果是( )。 A."123456" B.123456 C.102 D.显示出错信息
单选题在窗体上画一个名称为CD1的通用对话框,并编写如下程序:
Private Sub Command1_Click()
CD1.Filter="所有文件(*.*)|*.*|文本文件(*.txt)|*.txt|Word文档(*.doc)|*.doc"
CD1.FilterIndex=2
CD1.Action=2
End Sub
运行程序,并单击命令按Command1,下面描述中正确的是
单选题为使计时器对象每隔5秒钟产生一个时钟事件(Timer事件),则其Interval属性值应设置为( )
单选题设x是小于10的非负数。对此陈述,以下正确的VB表达式是
单选题在窗体上画一个命令按钮,其名称为Command1,然后编写如下程序: Option Base 1 Private Sub Command1_Click( ) Dim a As Variant a=Array(1,2,3,4) j=1 For i=4 To 1 Step-1 s=s+a(i)*j j=j*10 Next i Print s End Sub 运行上面的程序,单击命令按钮,其输出结果是______。 A) 4321 B) 12 C) 34 D) 1234
单选题使用Open语句可以打开或建立文件,并同时指定文件的输入输出方式。下列输入输出方式中错误的是( )。
单选题下列程序执行后,变量a的值为( )。Dim a,b,c,d As Singlea=10:b=20:c=40If b>a Thend=a:a=b:b=dEnd IfIf c>aT hend=a:a=c:c=dEnd IfIf c>b Thend=b:b=c:c=dEnd If
单选题编写如下程序:
Dim num As Integer,r As Integer,n As Integer,i As Integer,art(5)As Integer
Private Sub Commandl_Click()
num=12:r=2
Call sub1(num,r,n)
For i=n To 1 Step-1
Print arr(i);
Next i
End Sub
Sub sub 1(d As Integer,r As Integer,k As Integer)
k=0
Do While d<>0
k=k+1:arr(k)=d Mod r:d=d\r
Loop
End Sub
程序运行后,单击命令按钮Commandl,输出结果为
单选题要想不使用Shift或Ctrl键就能在列表框中国时选择多个项目,则应把该列表框的MultiSelect属性设置为
