有人编写了如下程序:Private Sub Form. Click( )Dim s As Integer,x As Integers=0x=0Do While S=1000x=x+ls=s+x^2LoopPrint sEnd Sub上述程序的功能是:计算s=1+22+32+…+n2+…,直到s10000为止。程序运行后,发现得不到正确的结果,必须进行修改。下列修改中正确的是( )。A.把x=0改为x=1.B.把Do While s=10000改为Do While s=10000C.do= while= s=10000D.交换x=x+1和s=s+x^2的位置

有人编写了如下程序:

Private Sub Form. Click( )

Dim s As Integer,x As Integer

s=0

x=0

Do While S=1000

x=x+l

s=s+x^2

Loop

Print s

End Sub

上述程序的功能是:计算s=1+22+32+…+n2+…,直到s>10000为止。程序运行后,发现得不到正确的结果,必须进行修改。下列修改中正确的是( )。

A.把x=0改为x=1.

B.把Do While s=10000改为Do While s<=10000

C.do="" while="" s="">10000

D.交换x=x+1和s=s+x^2的位置


相关考题:

在窗体上画一个命令按钮,然后编写如下程序: Sub S1(ByVal x As Integer,ByVal y As Integer) Dim t As Integer t=x x=y y=t End Sub Private Sub Command1_Click() Dim a As Integer,b As Integer a=10 b=30 S1 a,b Print"a=";a;"b=";b End Sub 程序运行后,单击命令按钮,输出结果是 ______。A.a=30 b=10B.a=30 b=30C.a=10 b=30D.a=10 b=10

有人编写了如下程序:Private Sub Form_Click()Dim s As Integer,x As Integers=0x=0Do While s=10000x=x+1s=s+x^2LoopPdnt sEnd Sub上述程序的功能是:计算s=1+22+32+…+n2+…,直到s10000为止。程序运行后,发现得不到正确的结果,必须进行修改。下列修改中正确的是A.把x=0改为x=1B.把Do While s=10000改为Do While s=10000C.把Do While s=10000改为Do While s10000D.交换x=x+l和s=s+x^2的位置

下面程序: Private Sub Form. _Click () Dim x, y, z As Integer x=5 y=7 z=0 Call P1(x, y, z) Print Str (z) End Sub Sub P1 (ByVal a As Integer, ByVal b As Integer , c As Integer) c= a+b End Sub 运行后的输出结果为______。A.0B.12C.Str(z)D.显示错误信息

设有如下程序: Private Sub Form. Click( ) Dim s As Long,f As Long Dim n As Integer,i As Integer f=1 n=4 For i=1 To n f=f*i s=s+f Next i Print s End Sub 程序运行后,单击窗体,输出结果是( )。A.32B.33C.34D.35

有人编写了如下程序: Private Sub Form. Click( ) Dim s As Integer,x As Integer s=0 x=0 Do While S=1000 x=x+l s=s+x^2 Loop Print s End Sub 上述程序的功能是:计算s=1+22+32+…+n2+…,直到s10000为止。程序运行后,发现得不到正确的结果,必须进行修改。下列修改中正确的是( )。A.把x=0改为x=1.B.把Do While s=10000改为Do While s=10000C.把Do While S=10000改为Do While s10000D.交换x=x+1和s=s+x^2的位置

在窗体中添加一个名称为Command1的命令按钮,然后编写如下程序: Public x As Integer Private Sub Command1_Click() x=10 Call s1 Call s2 MSgBox x End Sub Private Sub s1() x=x+20 End Sub Private Sub s2() Dim x As Integer x=X+20 End Sub 窗体打开运行后,单击命令按钮,则消息框的输出结果为______。A.10B.30C.40D.50

下列程序的运行结果为______。Private Sub Command1_ Click() Dim s As Long Dim x As Integer s = 0 for x = 99 To 1 step - 2 s=s+ x Next x Print sEnd SubA.100B.500C.2500D.5000

在窗体上画一今名称为Command1的命令按钮,然后编写如下事件过程: Private Sub Command1_Click() Dim a As Integer,s As Integer a=8 s=1 Do s=s+a a=a-1 Loop While a<=0 Print s;a End Sub 程序运行后,单击命令按钮,则窗体上显示的内容是 ______。A.79B.340C.97D.死循环

有如下函数过程: Function funl(ByVal x As Integer,ByVal y As Integer)As Integer Do While y<>0 reminder=x Mod y x=y y=reminder Loop fun1=x End Function 在下列按钮单击事件中调用该函数,则该程序的运行结果是( )。 Private Sub Command1_Click() Dim a As Integer Dim b As Integer a=100 b=25 x=funl(a,B)Print x End SubA.0B.25C.50D.100

有如下函数过程。Function UNC(ByVal x As Integer,ByVal y As Integer)As IntegerDo While y<>0S=x/yx=yy=SLoopUNC=xEnd Function以下事件调用该函数,程序运行结果是【 】。Private Sub Command1_Click()Dim a As IntegerDim b As Integera=12b=2x=UNC(a,b)Print xEnd Sub

在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程: Private Sub Command1_Click() Dim a As Integer,s As Integer a = 8 s = 1 Do s = s + a a = a - 1 Loop While a<=0 Print s,a End Sub 程序运行后,单击命令按钮,则窗体上显示的内容是A.7 9B.34 0C.9D.死循环

在窗体上画一个名称为CoilTlilandl的命令按钮,然后编写如下事件过程: Private Sub command1 Click() Dim m As Integer, i As Integer, x(3)As Integer For i=0 To 3:x(i)=i:Next i For i = 1 To 2: Call sub1(x,i):Next i For i = 0 To 3: Print x(i);: Next i End Sub Private Sub sub1(a()As Integer,k As Integer) Dim i As Integer Do a(k)=a(k)+a(k+1) j = j + 1 Loop While j < 2 End Sub 程序运行后,单击命令按钮,则窗体上显示的内容是A.0 3 7 5B.0 1 2 3C.3 2 4 5D.0 5 8 3

有如下事件过程: Function UNC (ByVal x As Integer,ByVal y As Integer) As Integer Do While y<>0 sic=x/y x=y y=sic Loop UNC=x End Function 以下是该函数的调用过程,该程序的运行结果是 PriVate Sub COmmand1_Click() Dim a As Integer Dim b As Integer a=12 b=2 x=UNC (a,B)Print x End SubA.0B.6C.2D.80

假定有如下事件过程: 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

在窗体上画一个名称为Commana1的命令按钮,然后编写如下程序: Dim SW As Boolean Function func(X As Integer)As Integer If X<20 Then Y=X Else Y=20+X End If func = Y End Function Private Sub Form. MouseDown(Button As Integer,_ Shift As Integer,X As Single, Y As Single) SW = False End Sub Private Sub Form_MouseUp( Button As Integer,_ Shift As Integer ,X As Single, Y As Single) SW = True End Sub Private Sub Commandl_Click( ) Dim intNum As Integer intNum = InputBox(" ") If SW Then Print func(intNum) End If End Sub 程序运行后,单击命令按钮,将显示一个输入对话框,如果在对话框中输入25,则程序的执行结果为A.输出0B.输出25C.输出45D.无任何输出

在窗体中添加一个名称为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 sub1 (ByVal x1 As String, y1 As String) Dim xt As String Dim i As Integer i = Len(x1) Do While i>= 1 xt = xt + Mid(x1, i, 1) i=i-1 Loop y1 = xt End Sub Private Sub Form. Click() Dim s1 As String, s2 As String s1= "teacher" sub1 s1, s2 Print s2 End Sub 程序运行后,单击窗体,则窗体上显示的内容是A.rehcaetB.tahreeeC.themeeD.eerthea

在窗体上画一个命令按钮,名称为Command1。然后编写如下程序: Private Sub Command1_Click() Dim a As Integer,b As Integer,c As Integer If a=0 Then x=x-1 Else If b<>0 Then End If End If If c<>0 Then x=3 Else x=4 End If Print x End Sub 程序运行后,单击命令按钮,其输出结果为 ______。A.34B.4C.35D.3

有如下函数过程。 Function Fun( By Val x As Integer,By Val y As Integer) As Integer Do While y <> 0 reminder = x Mod y xmy y = reminder Loop Fun = x End Function 以下调用函数的事件过程,该程序的运行结果是 Private Sub CommandT_Click( ) Dim a As Integer,b As Integer a = 100:b =25 x =Fun(a,B)Print x End SubA.0B.25C.50D.100

编写如下事件过程: Option Base 1 Private Sub Form Click() Dim x1()As Integer Dim i As Integer Dim s As Integer ReDim x1(3) For i = 1 To UBound(x1) x1(i)=i + 1 Next i Call sub1(x1) For i = 1 To UBound(x1) s = s + x1(i) Next i Print s End Sub Private Sub sub1(n()As Integer) Dim i As Integer ReDim Preserve n(5) For i = 3 To 5 n(i)=n(i-1)*2 Next i End Sub 程序运行后,单击窗体,则窗体上显示的内容是A.6B.12C.24D.47

有如下函数过程: Function gys(ByVal x As Integer,ByVal y As Integer) As Integer Do While y<>0 reminder = x Mod y x=y y=reminder Loop gys=x End Function以下是调用该函数的事件过程,该程序的运行结果是______。 Private Sub Command7_Click() Dim s As Integer Dim b As Integer a=100 b=25 x=gys(a,B)Print x End SubA. 0B.25C.50D.100

在窗体中添加一个名称为Command1的命令按钮,然后编写如下程序: Public x As Integer Private Sub Command1_Click() x=10 Call s1 Call s2 MsgBox x End Sub Private Sub sl() x=x+20 End Sub Private Sub s2() Dim x As Integer x=x+20 End Sub 窗体打开运行后,单击命令按钮,则消息框的输出结果为( )。A.10B.30C.40D.50

有如下函数过程: Function Fun (By Val x As Ingeger, ByVal y As Integer)As Integer Do While…y<>0 reminder=x Mod y x=y y=reminder Loop Fun=x End Function 以下是调用该函数的事件过程,该程序的运行结果是 Private Sub Command1_Click() Dim a As Integer Dim b As Integer a=100:b=25 x=Fun(a,b)Print x End SubA.0B.25C.50D.100

在窗体上面画一个命令按钮和一个标签,其名称分别为Command1和Label1,然后编写如下代码: Sub S(X As Integer,y As Integer) Static z As Integer y=x*x+Z z=y End Sub Private Sub Command1 Click( ) Dim i As Integer.z As Integer m=0 z=0 For i=1 T0 3 S i,Z m=m+z Next i Label1.Caption=Str(m) 程序运行后,单击命令按钮,在标签中显示的内容是( )。A.50B.20C.14D.7

在窗体上画一个按钮,然后编写如下的事件代码。在按钮上单击,输出为,( )。 Private Sub fun(ByVal x As Integer,ByVal y As Integer,Byval z As Integer) z=x^3*y^3 End Sub Private Sub Command1_Click() Dim m As Integer Call fun(2,3,m) Print m End SubA.216B.0C.35D.程序不能运行

在窗体上面一个名称为Command1的命令按钮,然后编写如下事件过程: Private Sub Command1_Click() Dim a As Integer, s As Integer a=8 s=1 Do s=s+a a=a-1 Loop While a<=0 Print s; a End Sub 程序运行后,单击命令按钮.则窗体上显示的内容是______。A.7 9B.34 0C.9 7D.死循环

在窗体上画一个命令按钮,名称为Command1。然后编写如下程序: Private Sub Command1_Click() Dim a As Integer,b As Integer,c As Integer If a=0 Then x=x-1 Else If b<>0 Then End If End If If c<>0 Then x=3 Else x=4 End If Print x End Sub程序运行后,如果单击命令按钮,则在窗体上显示的内容是( )。A.34B.4C.35D.3