单击“是(Y)”按钮删除指定记录后,下列操作能恢复被删除记录数据的是( )
①重新输入被删除的记录的内容 ② 立即执行“撤销”命令
③ 关闭当前数据库,重新打开 ④ 关闭该数据表,重新打开
Function f(n as integer) as long
Dim j As Integer
f=1
For j=1 to n
f=f*j
Next j
End Function
Private Sub Command1_Click()
Dim s As Long, AS Integer
S=0
For i=1 to 6
Next i
Text1.text=str(s)
End Sub
方框中正确的语句是 ( )
Private Sub Command1_Click()
Dim g As Integer
Dim p As Integer
p = 99 '预设价格的值存储到p变量中
g =
If g > p Then
= "对不起,偏高了!"
ElseIf g < p Then
Label4.Caption = "对不起,偏低了!"
Else
Label4.Caption = "恭喜你,猜对啦!"
End Sub
请回答下列问题:
程序运行界面如图所示,左边列表框List1中显示数据(成绩和姓名),单击 “开始排序”按钮(Command1),排序后的结果按成绩从高到低显示在列表框List2中。
解决此问题的排序部分的程序段如下:
Dim m(1 To 10) As Single
Dim name(1 To 10) As String
Private Sub Command1_Click( )
Dim i As Integer, j As Integer, k As Integer, x As Single, y As String
For i = 1 To 9
k = i
For j = i + 1 To 10
If ① Then k = j
Next j
If k <> i Then
x = m(i) : m(i) = m(k) : ②
y = name (i) : name (i) = name (k) : name (k) = y
End If
Next I
For I = 1 To 10
List2.AddItem Str(m(i)) + " " + name(i)
Next i
End Sub
Private Sub Form_Load()
' 此过程用于对数组a和数组b进行初始赋值,代码略
End Sub
在程序①和②划线处,填入适当的语句或表达式,把程序补充完整:
程序运行界面如图所示,左边列表框List1中显示的是会员卡号和余额,在文本框Text1中输入会员卡号,单击"查询余额"按钮(Command1)后,如果找到此卡号,则在标签Label2中显示"此卡号余额为"和卡号对应的余额值,如果未找到则显示"找不到此卡号,请重新输入"。
解决此问题的部分程序段如下:
Dim kh (1 To n) As Long
Dim ye (1 To n) As Single
Private Sub Command1_Click()
Dim x As Long, i As Long, j As Long, m As Long, f As Boolean
x = Val(Text1.Text)
i = 1: j = n: f = False ‘ 设卡号总数为n
Do While ①
②
If x = kh (m) Then
f = True
ElseIf x < kh (m) Then
j = m - 1
Else
③
End If
Loop
If f Then
Label2.Caption = "此卡号余额为" + Str(ye(m)) + "元"
Else
Label2.Caption = "找不到此卡号,请重新输入"
End If
End Sub
Private Sub Form_Load()
’此过程用于对数组kh和数组ye进行初始赋值,代码略
End Sub