根据上述要求编写VB程序,功能如下:读取n个人进,出馆的时间,显示在列表框List1中。程序运行时,在文本框Text1中输入指定人数,单击“统计”按钮Command1,在标签Label1中显示馆内人数超过指定人数的总时长。程序运行界面如图所示。

(1)在VB表达式Va1(Text1.Text)中,Va1、Text1、Text依次表示______(单选,填字母:A.方法名、属性名、事件名/B.函数名、对象名、方法名/C.函数名、对象名、属性名)。
(2)实现上述功能的VB程序如下,请在划线处填入合适的代码。
(3)程序中加框处代码有错,请改正。______
Const n = 800
Dim d(1 To n)As String,a(1 To 2 * n)As String
Private Sub Form_Load()
’读取n个人进、出馆的时间,存入数组d并显示在列表框List1中,代码略End Sub
Private Sub Command 1_ Cliek()
Dim i As Integer,j As Integer,k As Integer,sp As Integer
Dim i As Integer,cnt As Integer,mts As Integer,sum As Integer
Dim s As String
’提取每个人的进,出馆时间,分别加上IN、OUT标记后存入数组a
For i = l To na(i)=Mid(d(i),1,5)+"IN"

Next i
For i = 1 To 2 * n-1 对数组元素a(1)到a(2*n)从小到大排序
__
For i = i To 2 * n-1
If a(j) < a(k) Then k = j
Next j
s = a(i):a(i) = a(k):a(k)=s
Next i
sp =Val(Text1,Text)
t=-1:cnt=0:sum=0
For i = 1 To 2 * n
mts=Val(Mid(a(i),1,2))*60+Val(Mid(a(i),4,2))
If Mid(a(i),6,2)=“IN” Then cnt = cnt + 1 Else __If cnt > sp Then
If t = -1 Then t = mts
Elself t > -1 Then
__
t=-1
End If
Next iLabel1.Caption = "超过指定人数的总时长:"+Str(sum)+"分钟"
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

