网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

有如下事件过程:

Private Sub Form. Click( )

Dim n As Integcr

x=0

n=InputBox("请输入一个整数")

For i=1 To i

For i=1 To i

x=x+1

Next j

Next i

Print x

End sub

程序运行后,单击窗体,如果在输入对话框中输入5,则在窗体上显示的内容是( )。

A.13

B.14

C.15

D.16


参考答案

更多 “ 有如下事件过程:Private Sub Form. Click( )Dim n As Integcrx=0n=InputBox(请输入一个整数)For i=1 To iFor i=1 To ix=x+1Next jNext iPrint xEnd sub程序运行后,单击窗体,如果在输入对话框中输入5,则在窗体上显示的内容是( )。A.13B.14C.15D.16 ” 相关考题
考题 1+ + + +…….n 最大的n。请填空Private Sub Command1__Click()Dim s ,m,n AS Integerm=Val(InputBox(“请输入一个大于100的整数”))n=_______s=0Do While s N=n+1S=s+n*nLoopPrint “满足不等式的最大n是_______End Sub

考题 有一过程如下:Sub Sub1(m As Integer,total As Long)Dim i As Integertotal=1For i=1 To mtotal=total*iNextEnd Sub调用它的事件过程如下:Private Sub Command1_Click()Dim tot As Long,a As Integera=Val(InputBox("请输入数据"))Call Sub1(a,tot)Print totEnd Sub则输入数据5,运行结果为【 】。

考题 ( 35 )设在工程文件中有一个标准模块,其中定义了如下记录类型:Type BooksName As String * 10TelNum As String * 20End Type在窗体上画一个名为 Command1 的命令按钮,要求当执行事件过程 Command1_Click 时,在顺序文件Person.txt 中写入一条 Books 类型的记录。下列能够完成该操作的事件过程是A ) Private Sub Command1_Click()Dim B As BooksOpen “ Person.txt ” For Output As #`1B.Name=InputBox( “ 输入姓名 ” )B.TelNum=InputBox( “ 输入电话号码 ” )Write #1,B.Name,B.TelNumClose #1End SubB ) Private Sub Command1_Click()Dim B As BooksOpen “ Person.txt ” For input As #`1B.Name=InputBox( “ 输入姓名 ” )B.TelNum=InputBox( “ 输入电话号码 ” )Print #1,B.Name,B.TelNumClose #1End SubC ) Private Sub Command1_Click()Dim B As BooksOpen “ Person.txt ” For Output As #`1B.Name=InputBox( “ 输入姓名 ” )B.TelNum=InputBox( “ 输入电话号码 ” )Write #1,BClose #1End SubD ) Private Sub Command1_Click()Open “ Person.txt ” For input As #`1Name=InputBox( “ 输入姓名 ” )TelNum=InputBox( “ 输入电话号码 ” )Print #1, Name, TelNumClose #1End Sub

考题 下面程序运行结果是( )。 Private Sub Form_Click() Dim x As Single,y As Single x=InputBox("请输入数据25"):y=InputBox("请输入数据10") Print x+y;InputBox("请输入数据25")+InputBox("请输入数据10") End SubA._35_2510B.25102510C._35_35_D.2510_35_

考题 有如下事件过程:Private Sub Form. Click()Dim n As Integerx=0n=InputBox(”请输入一个整数”)For i=1 To iFor j=1 To ix=x+1Next jNext 1Print xEnd sub程序运行后,单击窗体,如果在输入对话框中输入5,则在窗体上显示的内容是( )。A.13B.14C.15D.16

考题 假定在工程文件中有一个标准模块,其中定义了如下记录类型Type BooksName As String * 10TelNum As String * 20End Type要求当执行事件过程Command1_Click时,在顺序文件Person.txt中写入一条记录。下列能够完成该操作的事件过程是( )。A.Private Sub Command1_Click()Dim B As BooksOpen "c:\Person.txt" For Output As #1B.Name = InputBox("输入姓名")B.TelNum = InputBox("输入电话号码")Write #1, B.Name, B.TelNumClose #1End SubB.Private Sub Command1_Click()Dim B As BooksOpen "c:\Person.txt" For Input As #1B.Name = InputBox("输入姓名")B.TelNum = InputBox("输入电话号码")Print #1, B.Name, B.TelNumClose #1End SubC.Private Sub Command1_Click()Dim B As BooksOpen "c:\Person.txt" For Output As #1Name = InputBox("输入姓名")TelNum = InputBox("输入电话号码")Write #1, BClose #1End SubD.Private Sub Command1_Click()Dim B As BookOpen "c:\Person.txt" For Input As #1Name = InputBox("输入姓名")TelNum = InputBox("输入电话号码")Print #1, B.Name, B.TelNumClose #1 End Sub

考题 下列程序用来计算1+2+…n,当和大于100时停止计算,请填空。Private Sub Form_Click()Dim n as integer,s as integer,I as integer,k as integers=0k=0n=inputbox(″请输入n的值)For i=1 to 100k=k+1s=s+I【 】Next iPrint sEnd Sub

考题 在窗体上画一个命令按钮,然后编写如下事件过程:Private Sub Command1 Click()a= Val(InputBox(“请输入一个整数”))b=Val(InputBox(“请输入一个整数”))Print a+bEnd Sub程序运行后,单击命令按钮,在输入对话框中分别输入12和34,输出结果为 ______。

考题 在窗体上画一外名称Command1的命令按钮,然后编写如下事件过程:Private Sub Command1_Click( )x=0n=InputBox(" ")For i = 1 To nFor j = 1 To ix=x+1Next jNext iPrint xEnd Sub程序运行后,单击命令按钮,如果输入3,则在窗体上显示的内容是【 】。

考题 在窗体上画一个命令按钮,然后编写如下事件过程:Private Sub Command1_Click()X=0Do While X<>-1X=Val(InputBox("请输入数据X:"))Y=Val(InputBox("请输入数据Y:"))If X*Y<X+Y Then Print X,YLoopEnd Sub程序运行后,依次输入7,2,-3,8,-5,-10,18,-1,-1,则输出结果是【 】

考题 在窗体上画一个命令按钮,然后编写如下事件过程。该程序运行后,单击命令按钮,在输入对话框中分别输入321和456,则输出结果为【 】。Private Sub Command1_Click()a=InputBox("请输入一个整数")b=InputBox("请再输入一个整数")Print a+bEnd Sub

考题 设在工程中有一个标准模块,其中定义了如下记录类型:Type Books Name As String *10 TelNum As String*20 End Type 在窗体上画一个名为Command1的命令按钮,要求当执行事件过程Command1_ Click时,在顺序文件 Person.txt中写入一条记录。下列能够完成该操作的事件过程是______。A.Private Sub Command1_ Click() Dim x As Books Open "C:\Person. txt" for Output As #1 x. Name=InputBox(“输入姓名”) x. TelNum=InPutBox(“输入电话号码”) Write #1,x.Name,x.TelNum Close #1 End SubB.Private Sub Command1_ Click() Dim x As Books Open "c:\Person. txt" for Input As #1 x.Name=InputBox(“输入姓名”) x. TelNum=InputBox(“输入电话号码”) Print #1,x. Name,x. TelNum Close #1End SubC.Private Sub Command1_ Click() Dim x As Books Open "c:\Person. txt" for Output As #1 x. Name=InputBox(“输入姓名”) x. TelNum= InputBox(“输入电话号码”) Write #1,x Close #1End SubD.Private Sub Command1_ Click() Dim x As Books Open "c:\Person. txt" for Input As #1 x. Name= InputBox(“输入姓名”) x.TelNum=InputBox(“输入电话号码”) Print #1,Name,TeINum Close #1End Sub

考题 在窗体上画一个命令按钮,然后编写如下事件过程: Private Sub Commandl—Click() x=InputBox(“请输入一个整数”) Print x+345 End Sub 程序运行后,单击命令按钮,在输入对话框中输入123,则在窗体上输出的内容为( )A.123345B.468C.123D.345

考题 有如下函致: Function fact(x As Integer)As Long Dim p As Long,i As Integer p=1 For i=1 To x p=p*1 Next fact=p End Function 调用它的事件过程如下: Private Sub Command1_Click() i=Val(Inputbox("请输入数据")) a=fact((i)) Print a End Sub 若输入数据5,则运行结果为A.120B.60C.80D.100

考题 有如下一个Sub过程: Sub mlt(ParamArray numbers()) n=1 For Each x In numbers n=n*x Next x Print n End Sub 在一个事件过程中如下调用该Sub过程: Private Sub Command1_Click() Dim a As Integer Dim b As Integer Dim c As Integer Dim d As Integer a=1 b=2 c=3 d=4 mlt a,b,c,d End Sub 该程序的运行结果为( )。A.12B.24C.36D.48

考题 有如下事件过程: Private Sub Form. Click( ) Dim n As Integcr x=0 n=InputBox("请输入一个整数") For i=1 To i for j =1 To j x=x+1 Next j Next i Print x End sub 程序运行后,单击窗体,如果在输入对话框中输入5,则在窗体上显示的内容是( )。A.13B.14C.15D.16

考题 在窗体上画一个命令按钮,然后编写如下事件过程:Private Sub Command1_Click()Do While b>=0a=Val(InputBox("请输入a的值"))b=Val(InputBox("请输入b的值"))c=a+bLoopMsgBox cEnd Sub程序运行后,依次输入3,2,1,0,-1,-2,则输出结果是______。

考题 有过程如下:Sub fact (m As Integer, total As Long) Dim i As Integer total = 1 for i = 1 To m total = total*i Next iEnd Sub调用它的事件过程如下:Private Sub Command1_ Click () Dim tot As Long Dim a As Integer a = Val InputBox (“请输入数据”)) Call fact (a, tot) Print totEnd Sub则输入数据5,运行结果为 ______。A.100B.120C.200D.50

考题 在窗体上画一个命令按钮,然后编写如下事件过程:Private Sub Command1_ Click() x=0 Do Until x=-1 a=InputBox(“请输入A的值”) a=Val(a)b=InputBox(“请输入B的值”) b=Val(b)x=InputBox(“请输入x的值”) x=Val(x) a=a+ b+ x Loop Print aEnd Sub程序运行后,单击命令按钮,依次在输入对话框中输入5、4、3、2、1、-1,则输出结果为 ______。A.2B.3C.14D.15

考题 假定有如下事件过程: Private Sub Form. Click() Dim x As Integer, n As Integer x=1 n=0 Do While x<28 x=x*3 n=n+1 Loop Print x, n End Sub 程序运行后,单击窗体,输出结果是______。A.81 4B.56 3C.28 1D.243 5

考题 在窗体上画一个名称为cl的命令按钮,然后编写如下事件过程: Private Sub Cl_Click( ) a=0n=InputBox(‘‘‘‘)Fori=lTonForj=lToia=a+lNextjNextiPrint aEnd Sub程序运行后单击命令按钮,如果输入4,则在窗体上显示的内容是( )。A.5B.6C.9D.10

考题 设在工程中有一个标准模块,其中定义了如下记录类型 Type Books Name As String*10 TelNum As String*20 End Type 在窗体上画一个名为Command1的命令按钮,要求当执行事件过程Command1_Click时, 在顺序文件Person.txt中写入一条记录。下列能够完成该操作的事件过程是______。A.Private Sub Command1_Click() Dim B As Books Open "c:\Person.txt" For Output As #1 B.Name=InputBox("输入姓名") B.TelNum=InputBox("输入电话号码") Write #1,B.Name,B.TelNum Close #1 End SubB.Private Sub Command1_Click() Dim B As Books Open "c:\Person.txt" For Input As #1 B.Name=InputBox("输入姓名") B.TelNum=InputBox("输入电话号码") Print #1, B.Name, B.TelNum Close #1 End SubC.Private Sub Command1_Click() Dim B As Books Open "c:\Person.txt" For Output As #1 B.Name=InputBox("输入姓名") B.TelNum=InputBox("输入电话号码") Write #1, B Close #1 End SubD.Private Sub Command1_Click() Dim B As Books Open "c:\Person.txt" For Input As #1 Name=InputBox("输入姓名") TelNum=InputBox("输入电话号码") Print #1, Name, TelNum Close #1 End Sub

考题 编写如下事件过程: Private Sub Form. Click() Dim Char As String,i As Integer Const ch$="#" msg$= "Enter a String:" char=InputBox$(msg$) n=Len(Char) For i=1 To n If Mid$(char,i,1)=ch$ Then Exit For End If Next i Print i - 1 End Sub 其中InputBox函数的功能是弹出一个输入对话框,按所给参数给出提示,等待用户输入,并返回输入的内容。程序运行后,单击窗体,如果在输入对话框内输入字符串“12ab$%*/#fg”,则窗体上输出A.2B.2C.5D.8

考题 在窗体上放一个文本框Text1,在文本框中输入456,并有如下事件过程, Private Sub Form. Click() x=InputBox("请输入一个整数") Print x+Text1. Text End Sub 单击该窗体,在输入对话框中输入123,单击“确定”按钮后,窗体上显示是( )。A.123B.456C.579D.123456

考题 设在工程中有一个标准模块,其中定义了如下记录类型 Type Books Name As String* 10 TelNum As String * 20 End Type 在窗体上画一个名为 Command1的命令按钮,要求当执行事件过程Command1 Click时, 在顺序文件Person.txt中写入一条记录。 下列能够完成该操作的事件过程是 ______。A.Private Sub Command1_Click( ) Dim B As Books Open "c:\Person.txt" For Output As #1 B.Name = InputBox("输入姓名") B.TelNum = InputBox("输入电话号码") Write #1, B.Name, B.TelNumB.Private Sub Command1_Click( ) Dim B As Books Open "c:\Person.txt, For Input As # 1 B.Name = lnputBox("输入姓名") B.TelNum = InputBox("输入电话号码") Print #1, B.Name, B.TelNttmC.Private Sub Command1_Click( ) Dim B As Books Open "c:\Person.txt" For Output As #1 B.Name = InputBox("输入姓名") B.TelNum = InputBox("输入电话号码") Write # 1, B Close #D.Private Sub Command1_Click( ) Dim B As Books Open"c:\Person.txt" For Input As #1 Name=InputBox("输入姓名") TelNum=InputBox("输入电话号码") Print #1,Name,TelNum Close #1 End Sub

考题 假定在工程文件中有一个标准模块,其中定义了如下记录类型: Type Books Name As String*10 TelNum As String*20 End Type 要求当执行事件过程Command1_Click时,在顺序文件Person. txt中写入一条记录。下列能够完成该操作的事件过程是______。A.Private Sub Command1_Click() Dim B As Books Open"c:\Person. txt" For Output As #1 B. Name=InputBox("输入姓名") B. TelNum=InputBox("输入电话号码") Write #1, B. Name, B. TelNum Close #1 End SubB.Private Sub Command1_Click() Dim B As Books Open"c:\Person txt" For Output As #1 B. Name=InputBox("输入姓名") B. TelNum=InputBox("输入电话导码") Print #1, B. Name, B. TelNum Close #1 End SubC.Private Sub Command1_Click() Dim B As Books Open"c:\Person. txt" For Output As #1 Name=InputBox("输入姓名") TelNum=InputBox("输入电话号码") Print #1, B Close #1 End SubD.Private Sub Command1_Click() Dim B As Books Open "c:\Person txt" For Output As #1 Name=InputBox("输入姓名") TelNum=InputBox("输入电话号码") Print #1, B Name, B. TelNum Close #1 End Sub

考题 窗体Form. 1上有一个名称为Command 1的命令按钮,以下对应窗体单击事件的事件过程是A)Private Sub Form. 1_Click() B)Private Sub Form. _Click()End Sub End SubC)Private Sub Commandl_Click() D)Private Sub Command_ Click()End Sub End Sub