
(1)Cmd1 对象属于___________ 类(单选,填字母:A.Form / B.Label / C. TextBox D.CommandButton)
(2)实现上述功能的 VB 程序如下,请在划线处填入合适的代码。
(3)程序中加框处代码有错,请改正。
Private Sub Cmd1_Click()
Dim s As String, s1 As String, t As Integer, i As Integer
Dim k As Integer, bh As Integer, w As Integer
Dim w1 As Integer, w2 As Integer
s = Text1.Text: k = 1: t = 0: bh = 0 'bh 存储当前垃圾的垃圾编号
w1 = 0: w2 = 0For i = 1 To Len(s)
s1 = Mid(s, i, 1)
If ______Then
t = t * 10 + Val(s1)
Else
If ______Then
bh = t
Else
If bh = 1 Then
w1 = w1 + t
Elsew2 = w2 + t
End If

End If
k = k + 1
________
End IfNext i
List1.AddItem "干垃圾共" + Str(w1) + "斤"
List1.AddItem "湿垃圾共" + Str(w2) + "斤"
Label3.Caption = "总重量共有" + Str(w) + "斤"
End Sub
同类型试题

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

