设有如下程序: Private Sub Command1_Click() Dim sum As Double,x As Double sum=0 n=0 Fori=1 To 5 x=n/i n=n+1 sum=sum+x Nexti End Sub 该程序通过For循环来计算一个表达式的值,这个表达式是( )。A.1+1/2+2/3+3/4+4/5B.1+1/2+1/3+1/4+1/5C.1/2+2/3+3/4+4/5D.1/2+1/3+1/4+1/5

设有如下程序: Private Sub Command1_Click() Dim sum As Double,x As Double sum=0 n=0 Fori=1 To 5 x=n/i n=n+1 sum=sum+x Nexti End Sub 该程序通过For循环来计算一个表达式的值,这个表达式是( )。

A.1+1/2+2/3+3/4+4/5

B.1+1/2+1/3+1/4+1/5

C.1/2+2/3+3/4+4/5

D.1/2+1/3+1/4+1/5


相关考题:

( 33 )设有如下程序:Private Sub Commandl Click ()Dim sum As Double, x As Doublesum = 0n = 0For i=l To 5x = n / in = n + 1sum 二 sum + xNext iEnd Sub该程序通过 For 循环来计算一个表达式的值,这个表达式是A ) 1+1/2+2/3+3/4+4/5B ) 1+1/2+1/3+1/4+1/5C ) 1/2+2/3+3/4+4/5D ) 1/2+1/3+1/4+1/5

设有命令按钮Command1的单击事件过程,代码如下:Private Sub Command1_Click()Dim a(3,3)As IntegerFor i=1 To 3For j=1 To 3a(i,j)=i*j+iNext jNext iSum=0For i=1 To 3Sum=Sum+a(i,4-i)Next iPrint SumEnd Sub运行程序,单击命令按钮,输出结果是( )。A.20B.7C.16D.17

设有如下程序: Private Sub Command1_Click() Dim sum As Double, k As Double sum=0 n=0 For i=1 To 5 k=n/i n=n+1 sum=sum+k Next End Sub 该程序通过For循环计算一个表达式的值,这个表达式是______。A.1+1/2+2/3+3/4+4/5B.1+1/2+2/3+3/4C.1/2+2/3+3/4+4/5D.1+1/2+1/3+1/4+1/5

在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程: Private Sub Command1_Click() Sum=0 For x=1 To 5 Call subl(x, s) Sum=Sum+s Next x Print Sum End Sub Private Sub subl(y, w) w=1 For i=1 To y w=w*i Next i End Sub 程序运行后。单击命令按钮,则窗体上显示的内容是______。A.5B.120C.153D.160

设有如下程序:Private Sub Form_Click()Dim i As Integer,x As String,Y As Stringx=”ABCDEFG”For i=4 To 1 Step-1y=Mid(x,i,i)+yNext iPrint yEnd Sub程序运行后,单击窗体,输出结果为A.ABCCDEDEFGB.AABBCDEFGC.ABCDEFGD.AABBCCDDEEFFGG

设有如下程序:Private Sub Form_Click()Dim ary(1 To 5)As IntegerDim i As IntegerDim sum As IntegerFor i=1 To 5ary(j)=i+1sum=sum+ary(i)Next 1Print sumEud Sub程序运行后,单击窗体,则在窗体上显示的是A.15B.16C.20D.25

在窗体上画一个命令按钮,然后编写如下事件过程:Private Sub Command1_Click()Dim Y as StringX=5Y=X Space(3) XPrint X;Print Trim(Y);Len(Trim(Y))End Sub该程序的执行结果是【 】。

设有如下程序:Private Sub Command1 Click( ) Dim sum AS Double,x As Double sum=0 n=0 For i=1 To 5 x=n/i n=n+1 sum=sum+x Next i End Sub 该程序通过For循环来计算一个表达式的值,这个表达式是______。A.1+1/2+2/3+3/4+4/5B. 1+1/2+1/3+1/4+1/5C. 1/2+2/3+3/4+4/5D. 1/2+1/3+1/4+1/5

阅读下列程序: Function func(n As Integer)As Integer Sum = 0 For i = 1 To n Sum = Sum + (i + 1)* i Next i func = Sum End Function.Private Sub Command1_Click () Dim a As Integer a= 5 s = func (A)Print s End Sub 程序运行后,单击命令按钮,输出的结果为A.80B.60C.70D.15

设有如下程序:Private Sub Form. Click( )Dim ary(1 To 5)As IntegerDim i As IntegerDim sum As IntegerFor i=1 To 5ary(i)=i+lsum=sum+ary(i)Next iPrint sumEnd Sub程序运行后,单击窗体,则在窗体上显示的是( )。A.15B.16C.20D.25

设有如下程序 Private Sub Command1_Click( . Dim sum As Double, x As Double sum = 0 n = 0 For i=1 To 5 x = n / i n = n + 1 sum = sum + x Next i End Sub 该程序通过For循环来计算一个表达式的值,这个表达式是A.1+1/2+2/3+3/4+4/5B.1+1/2+1/3+1/4+1/5C.1/2+2/3+3/4+4/5D.1/2+1/3+1/4+1/5

设有如下程序: Private Sub Command1_ Click() Dim sum As Double, x As Double sum=0 n=0 For i=1 To 3 x=n/i n=n+1 sum=sum+x Next i End Sub 该程序通过For循环来计算sum的值,sum值的精确结果是( )。A.1+1/2+2/3B.1+1/2+1/3+1C.1/2+2/3D.1/2+1/3

Command1_Click()事件代码如下: Private Sub Command1_Click() Dim x As Integer, Y As Integer x = 6 : Y : 8 Call ABC(X, Y) Print X; Y End Sub Private Sub ABC(ByVal X As Integer,Y As Integer) X = X + 4 Y = Y = 2 End Sub 事件发生后,X和Y的值分别为 ______。A.6, 8B.10, 10C.10, 8D.6, 10

在窗体上画一个名称为 Command1的命令按钮,然后编写如下事件过程: Private Sub Command1_Click() Dim a(4)As Integer, x As Integer, sum As Integer n = 4: sum = 0 a (1) = 1 For k = 0 To n - 1 For i = 1 To k + 1 x = k + 2 - i a(x)= a(x)+ a(x - 1) If x < n - k Then Exit For sum = sum + a(x) Next i Next k Print sum End Sub 程序运行后,单击命令按钮,则窗体上显示的内容是A.5B.6C.8D.11

有如下程序: Private Sub Command1_Click() Dim a As Single Dim b As Single a=5:b=4 Call Sub1(a,b) End Sub Sub Sub1(x As Single,y As Single) t=X X=t\Y Y=t Mod y End Sub 在调用运行上述程序后,a和b的值分别为A.0 0B. 1 1C.2 2D.1 2

设有如下程序: Private Sub Command1_Click() Dim sum As Double,x As Double sum=0 n=0 For i=1 To 5 x=n/i n=n+1 sum=sum+x Next End Sub 该程序通过For循环计算一个表达式的值,这个表达式是 ______。A.1+1/2+2/3/4+4/5B.1+1/2+2/3+3/4C.1/2+2/3+3/4+4/5D.1+1/2+1/3+1/4+1/5

有如下一个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

假定有如下的Sub过程: Sub Func(x As Single, y As Single) t=x x=t/y y=t Mod y End Sub 在窗体上画一个命令按钮,然后编写如下事件过程: Private Sub Command1_Click() Dim a As Single Dim b As Single a=6 b=5 Func(a, B) Print a, b End Sub 程序运行后,单击命令按钮,输出结果为 ______。A.6 5B.1 1C.1.2 5D.1.2 1

在窗体上面一个名称为Commandl的命令按钮,然后编写如下程序: Option.Base 1 Private Sub Command1_Click() Dim a As Variant a=Array(1,2,3,4,5) Sum = 0 For i = 1 To 5 Sum=Sum+a(i) Next i x=Sum/5 For i=1 To 5 If a(i) >x Then Print a(i); Next i End Sub 程序运行后,单击命令按钮,在窗体上显示的内容是A.1 2B.1 2 3C.3 4 5D.4 5

设有如下程序: Private Sub Cimmandl_Click. Dim sum As Double, x As Double Sum=0 n =0 For i =1 To 5 x =n/i n =n +1 sum =sum +x Next i End Sub 该程序通过For 循环来计算一个表达式的值,这个表达式是 A.1+1/2+2/3+3/4+4/5 B.1+1/2+1/3+1/4+1/5 C.1/2+2/3+3/4+4/5 D.1/2+1/3+1/4+1/5

以下能够正确计算1+2+3+…+10的程序是A.Private Sub Command1_Click() Sum=0 ForI=1 To 10 Sum=Sum+I Next I Print Sum End SubB.Private Sub Command1_Click() Sum=0,I=1 Do While I<=10 Sum=Sum+I I=I+1 Print Sum End SubC.Private Sub Command1_Click() Sum=0: I=1 Do Sum=Sum+I I=I+1 Loop While I<10 Print Sum End SubD.Private Sub Command1_Click() Sum=0: I=1 Do Sum=Sum+I I=I+1 Loop Until I<10 Print Sum End Sub

设有如下程序: Private Sub Command1_Click() Dim Sum As Double, x As Double sum=0 n = 0 For i= 1 To 5 x = n / i n = n + 1 sum=sum+x Next End Sub 该程序通过For循环计算一个表达式的值,这个表达式是A.1+1/2+2/3+3/4+4/5B.1+1/2+2/3+3/4C.1/2+2/3+3/4+4/5D.1+1/2+1/3+1/4+1/5

在窗体上画一个名称为Command1的命令按钮,然后编写如下程序: Option Base1 Private Sub Command1_Click( ) Dim a As Variant a=Array(1,2,3,4,5) Sum=0 For i=1To 5 Sum=Sum+a(i) Next i x=Sum/5 For i=1 To 5 If a(i)x Then Print a(i); Next i End Sub程序运行后,单击命令按钮,在窗体上显示的内容是A.1 2B.1 2 3C.3 4 5D.4 5

设有如下程序Private Sub Command1_Click( .Dim sum As Double, x As Doublesum = 0n = 0For i=1 To 5x = n / in = n + 1sum = sum + xNext iEnd Sub该程序通过For循环来计算一个表达式的值,这个表达式是A.1+1/2+2/3+3/4+4/5B.1+1/2+1/3+1/4+1/5C.1/2+2/3+3/4+4/5D.1/2+1/3+1/4+1/5

设有如下程序: Private Sub Commandl_Click0Dim sum As Double.x As DoubleSum=0n=0Fori=1 T0 5x=n/in=n+1surll=surrl+XNextiEndSub该程序通过For循环来计算一个表达式的值,这个表达式是( )。A.1+1/2+2/3+3/4+4/5B.1+1/2+1/3+1/4+1/5C.1/2+2/3+3/4+4/5D.1/2+1/3+1/4+1/5

设有如下程序: Private Sub Form. Click( ) Dim ary(1 To 5)As Integer Dim i As Integer Dim sum As Integer For i=1 To 5 ary(i)=i+l sum=sum+ary(i) Next i Print sum End Sub 程序运行后,单击窗体,则在窗体上显示的是( )。A.15B.16C.20D.25

以下能够正确计算1+2+3+…+10的程序是A.Private sub Command1_Click( ) sum=0 For 1=1 To 10 Sum=sum+1, Next I Print Sum End SubB.Private sub Command1_Click( ) Sum=0,I=1 Do While l<=10 Sum=Sum+1 I=I+1 Print Sum End SubC.Private Sub command1_click( ) Sum=0:I=1 Do Sum=Sum+1 I=I+1 Loop While I<10 Print Sum End SubD.Private Sub command1_Click( ) Sum=0:I=1 Do Sum=Sum+1 l=I+1 Loop Until I<10 Print Sum End Sub

设有Function过程:Private Function f(a As Integer, b As Integer) As Integera = a * a:b = b * bf = CInt(Sqr(a - b))End Function则如下程序段的运行结果是( )。Private Sub Command1_Click()Dim X As Integer, Y As IntegerX = 5: Y = 4a = f(X, Y)Print aEnd SubA. 5B. 4C. 3D. 9