设有如下程序: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 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/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 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 Form_Click() Dim i As Integer,Sum As Integer Sum=0 For i=2 To 10 If i Mod 2<>0 And i Mod 3=0 Then Sum=Sum+i End If Next Print Sum End Sub 程序运行后,单击窗体,输出结果为A.12B.30C.24D.18

设有如下程序: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的命令按钮,然后编写如下事件过程: 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 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

有如下程序: Private Sub Form_Click( ) Dim i As Integer, Sum As Integer Sum = 0 For i = 2 To 10 If i Mod 2=0 And i Mod 3<>0 Then Sum = Sum + i End If Next Print Sum End Sub 程序运行后,单击窗体,输出结果为A.12B.30C.24D.18

设有如下程序: Dim a()As Integer Private Sub Command1_Click() n=-5:m=6 ReDim a(n To m) For i=LBound(a,1)To UBound(a,1) a(i)=i Next i Print a(LBound(a,1));a(UBound(a,1)) End Sub 程序运行后,单击命令按钮,则输出结果是 ______。A.0 0B.-5 0C.-5 6D.0 6

在窗体上面一个名称为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 Form. Click() Dim i As Integer,sum As Integer sum=0 For i=2 To 10 If i Mod 2 <>0 And i Mod 3=0 Then sum=sum+i End If Next i Print sum End Sub 程序运行后,单击窗体,输出结果为______。A. 12B.30C.24D.18

设有如下程序: 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

有如下程序: Private Sub Form_Click() Dim i As Integer, Sum As Integer sum=0 For i=2 To 10 If i Mod 2<>0 And i Mod 3=0 Then sum=sum+i End If Next i Print sum End Sub 程序运行后,单击窗体,输出结果为______。A.12B.30C.24D.18

以下能够正确计算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_CHck() Dim i As Integer,sum As Integer sum=0 For i=2 TO 10 If Mod 2 <>And i Mod 3=0 Then sum=sum+i End If Next i Print sum End Sub 程序运行后,单击窗体,输出结果为______。A.12B.30C.24D.18

设有如下程序: 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

设有如下程序: 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