有如下程序: Private Sub Command1_Click() Fo rj=1 To 10 a=a+j/7 Next j Print a End Sub 在运行时输出a的值是()A、5B、4C、3D、2
有如下程序: Private Sub Command1_Click() Fo rj=1 To 10 a=a+j/7 Next j Print a End Sub 在运行时输出a的值是()
- A、5
- B、4
- C、3
- D、2
相关考题:
在运行程序的过程中,当执行“复制”(mnuEditCopy)命令时,使“粘贴”(munEditPaste)命令变为可用,则应做如下处理( )。A.Private Sub nuEditPaste_Click() …… mun EditPaste.Enable=True End SubB.Private Sub mnuEditCopy click …… muEditPaste.Enable=True End SubC.Privat Sub munEditPaste_Click() …… mnuEditPaste.Visible=Tme End SubD.Private Sub munEditCopy_ClicK() …… munEditPaste.Visible=Tme End Sub
在窗体上画一个名称为Text1的文本框,并编写如下程序: Private Sub Form_Load() Show Text1.Text=" Text1.SetFocus End Sub Phvate Sub Form_MouseUp(Buuon As Integer,Shift As Integer,X As Single,Y As Single) Phnt“程序设计” End Sub Private Sub Textl_KeyDowA.Visual BasicB.程序设计C.A程序设计D.VisualBasic程序设计
对窗体编写如下事件过程: 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 程序运行后,如果单击鼠标右键,则输出结果为______ 。A.AAAAA BBBBBB.BBBBBC.AAAAAD.BBBBB AAAAA
设有如下程序:Private Sub Form_Click()Dim n As Integer, s As Integern = 8s = 0Dos = s + nn = n - 1Loop While n 0Print sEnd Sub以上程序的功能是______。程序运行后,单击窗体,输出结果为______。
( 8 )有如下程序:Private Sub Form_Click ()n=10i=0Doi=i+nn=n-2Loop While n2Print iEnd Sub程序运行后,单击窗体,输出结果为 【 10 】 。
有弹出式菜单的结构如下表,程序运行时,单击窗体则弹出如下图所示的菜单。下面的事件过程中能正确实现这一功能的是( )。A.Private Sub Form_Click() PopupMenu cut End SubB.Private Sub Command1_Click() PopupMenu edit End SubC.Private Sub Form_Click() PopupMenu edit End SubD.Private Sub Form_Click() PopupMenu cut End Sub
在窗体上添加一个按钮(cmd) ,编写如下程序:Private sub crud_click( )Dim s, iFori = 1 to 10s=s+iNextMsgbox sEnd sub程序运行后,单击按钮,在消息框中显示的信息为 【 】 。
编写如下两个事件过程: Private Sub Form_KeyDown(KeyCode As Integer,Shift As Integer) Print Chr(KeyCode) End Sub Private Sub Form_KeyPress(KeyAscii As Integer) Print Chr(KeyAscii) End Sub 在一般情况下(即不按住“Shift”键和锁定大写键时)运行程序,如果按“A”键,则程序输出的结果是A. A AB.a AC. A aD.a a
有如下SUB过程:Sub s(x As Single,y As Single)t=xx=t / yy=t Mod yEnd Sub在窗体上添加一个命令按钮,然后编写如下事件过程:Private Sub Form_Click()Dim a As SingleDim b As Singlea=5b=4s a,bPrint a,bEnd Sub则程序运行后,单击命令按钮,输出的结果为【 】 。
设程序中有如下数组定义和过程调用语句: Dim a(10)As Integer … Call D(a) 如下过程定义巾,正确的是( )。A.Private Sub p(a As Integer)B.Private Sub p(a( )As Integer)C.Private Sub p(a(10)As Integer)D.Private Sub p(a(n)As Integer)
有如下程序:Private Sub Command1_Click()j =10For i= -1 To 1 Step 0.3j =j + 1Next iPrint jEnd Sub该程序共循环【 】次,程序执行完毕后j的值是【 】。
如下图所示,只执行下列程序后,有Text1.Text=Text1,文本框不能出现“*****”的程序是______。A.Private Sub form_ Load() Text1. Text="*****"End SubB.Private Sub form_ Load() Text1. PasswordChar=“*”End SubC.Private Sub form_ Load() Text1. Visible="*****" End SubD.Private Sub form. Load() Text1. Text= String(5,"*")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 "VisualBasic"; End Sub 程序运行后,如果按A键,然后单击窗体,则在窗体上显示的内容是 ______。A.Visual BasicB.程序设计C.A程序设计D.Visual Basic程序设计
设有如下程序: Private Sub search(a()As Variant,ByVal key As Variant,index%) Dim I% For I = Lbound(a)To Ubound(A)If key=a(I)Then index=I Exit Sub End If Next I index=-1 End Sub Private Sub Form_Load() Show Dim b()As Variant Dim n As Integer b=Array(21,64,92,15,72,38,45,72) Call search(b, 45, n) Print n End Sub 程序运行后,输出的结果是A.2B.6C.10D.12
设窗体上有一个名为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 BasicB.程序设计C.Visual Basic程序设计D.a程序设计
设有如下程序:Private Sub Form—Click()Clsa$=“ABCDFG”For i=1 T0 6Print Tab(12-i);【 】NextiEnd Sub程序运行后,单击窗体,结果如图所示,请填空。
编写如下事件过程: Private Sub Form_KeyDown (KeyCode As Integer,Shift As Integer) Print Chr(KeyCode) End Sub Private Sub Form_Key Press (KeyAscii As Integer) Print Chr (Key Ascii) End Sub 在一般情况下(即不按住Shift键和锁定大写键时)运行程序,若按“T”键,则程序输出的结果是A.T TB.t TC.T TD.t t
设程序中有如下数组定义和过程调用语句:Dim a(10) as integer……Call p(a)如下过程定义中,正确的是A)Private Sub p(a as integer)B)Private Sub p(a() as integer)C)Private Sub p(a(10) as integer)D)Private Sub p(a(n) as integer)
假定有如下的Sub过程:Sub Sub1(x As Single,y As single)t=xx=t/yy=t Mod yEnd Sub在窗体上画一个命令按钮,然后编写如下事件过程:Private Sub Command1_click()Dim a As SingleDim b As Singlea=5b=4Sub1 a,bPrint a;bEnd Sub程序运行后,单击命令按钮,输出结果为A.B.C.D.
在窗体中添加一个名称为Commandl的命令按钮,然后编写如下程序:Public X As Integer Private Sub Commandl Click( )x=10 Call slCall s2MsgBox x End Sub Private Sub sl( )x=x+20 End Sub Private Sub s2( )Dim x As Integer x=x+20End Sub窗体打开运行后,单击命令按钮,则消息框的输出结果为( )。A.10B.30C.40D.50
对窗体编写如下事件过程: Private Sub Form_ Mouse Down(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 程序运行后,如果单击鼠标右键,则输出结果为 ______。A.AAAAA BBBBBB.BBBBB AAAAAC.AAAAAD.BBBBB
有弹出式菜单的结构如右表,程序运行时,单击窗体则弹出如下图所示的菜单。下面的事件过程中能正确实现这一功能的是( )。A.Private Sub Vorm Click( ) PopupMenu cut End SubB.Private Sub Command1 Click( ) PopupMenu edit End SubC.Private Sub Form. Click( ) PopupMenu edit End SubD.Private Sub Form. Click( ) PopupMenu cut PopupMenu paste End Sub
在窗体中添加一个名称为Commandl的命令按钮,然后编写如下程序: Public x As Integer Private Sub Commandl_click() x=10 Call s 1 Call s 2 MsgBOx x End Sub Pfivate Sub s1() x=x+20 End Sub Private SubA.10B.30C.40D.50
在窗体上画了两个按钮控件Command1和Command2,有如下程序: Private Sub Command1_Click() Print "Visual"; End Sub Private Sub Command2_Click() Print "Basic"; End Sub Private Sub Form_Load() CommandCancel=True Command1.Cancel=True End Sub 执行程序后,按键盘Cancel键,在窗体上输出的结果是A.BasicB.VisualC.CancelD.True
在窗体上画一个名称为Text1的文本框,并编写如下程序: Private Sub Form Load( ) Show Text1.Text="" Text1.SetFocus End Sub Pfivate Sub Form_MouseUp(BuHon 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"Visua1 Basic"; End Sub 程序运行后,如果按“A”键,然后单击窗体,则在窗体上显示的内容是A.VisualBasicB.程序设计C.A程序设计D.Visual Basic程序设计
把窗体的KeyPreview属性设置为True,然后编写如下过程: Private SubForm_KeyDown(KeyCode As Integer,Shift As Integer) PrintChr (KeyCode) End Sub Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer) PrintChr(KeyCode+2) End Sub 程序运行后,如果按“A”键,则输出结果为 ______。A.A AB.A BC.A CD.A D
9)设有如下程序:Private Sub Form_Click( )Clsa$="ABCDFG"For i=1 To 6Print Tab(12-i); 【9】Next iEnd Sub程序运行后,单击窗体,结果如图所示,请填空。
有如下Sub过程:Sub ind(a As Integer)Static x As Integerx= x + aPrint x:End Sub以下是调用它的事件过程,程序运行后,单击命令按纽Command1三次,输出结果为【 】。Private Sub Command1_Click()Ind 2End Sub