(1) Cmd对象属于______类。
(单选,填字母:A. Form / B. Label / C.TextBox / D. CommandButton )
(2)实现上述功能的VB程序如下,请在划线处填入合适代码。
Private Sub Cmd_Click()
Dim i As Integer,j As Integer,k As Integer
Dim x1 As Single,y1 As Single,x2 As Single,y2 As Single
Dim d As Single,Totald As Single,v As Single,s As String
s =______①
x1 = 0: y1 = 0'出发点为坐标原点
k = 1 : j = 1 : Totald = 0
For i = 1 To Len(s)
If Mid(s,i,1) =","Then
v = Val(Mid(s,j,i - j))'提取坐标值,保存在变量v中
j = i + 1
If ② Then
x2 = v
Else
y2 = v
d = Sqr((x2 — x1)^2 + (y2 — y1)^ 2)
Totald = Totald + d
x1 = x2 : y1 = y2
End If
k = k + 1
End If Next i
Label1. Caption = Str(Totald)
End Sub
(3) 运行该程序,输入数据如上图所示,程序执行到循环结束时,变量k的值为______。
同类型试题
y = sin x, x∈R, y∈[–1,1],周期为2π,函数图像以 x = (π/2) + kπ 为对称轴
y = arcsin x, x∈[–1,1], y∈[–π/2,π/2]
sin x = 0 ←→ arcsin x = 0
sin x = 1/2 ←→ arcsin x = π/6
sin x = √2/2 ←→ arcsin x = π/4
sin x = 1 ←→ arcsin x = π/2
y = sin x, x∈R, y∈[–1,1],周期为2π,函数图像以 x = (π/2) + kπ 为对称轴
y = arcsin x, x∈[–1,1], y∈[–π/2,π/2]
sin x = 0 ←→ arcsin x = 0
sin x = 1/2 ←→ arcsin x = π/6
sin x = √2/2 ←→ arcsin x = π/4
sin x = 1 ←→ arcsin x = π/2