1、【
简答题】
[10分]
解析:
按要求解答即可
2、【
简答题】
'提供给考生的程序
Private Function isprime(a As Integer) As Boolean
Dim flag As Boolean
flag = True
b% = 2
Do While b% <= Int(a / 2) And flag
If Int(a / b%) = a / b% Then
flag = False
Else
b% = b% + 1
End If
Loop
isprime = flag
End Function
[10分]
解析:
'要求考生编写的程序
Private Sub C1_Click()
a% = 15000
Do
a% = a% + 1
Loop Until isprime(a%)
Text1.Text = a%
End Sub
Private Sub C2_Click()
Open App.Path & "\out5.txt" For Output As #1
Print #1, Text1.Text
Close #1
End Sub
3、【
简答题】
[10分]
解析:
Private Sub Command1_Click()
CD1.ShowOpen
End Sub
4、【
简答题】
Private Function IsPrime(ByVal x As Integer) As Boolean
Dim i As Integer
For i = 2 To Sqr(x)
If x Mod i = 0 Then
IsPrime = False
Exit Function
End If
Next
IsPrime = True
End Function
Private Sub Command1_Click()
'考生编写程序开始
'======================================
????
'=========================================
'考生编写程序结束
Open App.Path & "\out5.dat" For Output As #1
Print #1, Text1.Text, Label1(0).Caption, Label1(1).Caption, Label1(2).Caption
Close #1
End Sub
[10分]
解析:
Dim i As Integer
Dim n As Integer
Dim counter As Integer
Dim arr(3) As Integer
n = Val(Text1.Text)
counter = 0
For i = n - 2 To 3 Step -2
If IsPrime(i) Then
arr(counter) = i
counter = counter + 1
If counter = 3 Then
Exit For
End If
End If
Next
For i = 0 To 2
Label1(i).Caption = arr(i)
Next
5、【
简答题】
[10分]
解析:
Private Sub C1_Click()
End
End Sub
6、【
简答题】
'提供给考生
'Private Sub C1_Click()
'' For i = ? To ?
'' If Op1(i).? = True Then
'' Print "我的出生地是" + Op1(i).?
' End If
' Next
'End Sub
[10分]
解析:
Private Sub C1_Click()
For i = 0 To 2
If Op1(i).Value = True Then
Print "我的出生地是" + Op1(i).Caption
End If
Next
End Sub
7、【
简答题】
Private Sub C1_Click()
Dim k As Integer
For k = 0 To 2
' If Op1(k).? = True Then
' Call draw(?)
End If
Next k
End Sub
Sub draw(a As Integer)
P1.Print "选择了" & Op1(a).Caption
End Sub
[10分]
解析:
Private Sub C1_Click()
Dim k As Integer
For k = 0 To 2
If Op1(k).Value = True Then
Call draw(k)
End If
Next k
End Sub
Sub draw(a As Integer)
P1.Print "选择了" & Op1(a).Caption
End Sub
8、【
简答题】
[10分]
解析:
Private Sub C1_Click()
T1.Enabled = True
End Sub
Private Sub T1_Timer()
Text1.Text = Text1.Text + 1
End Sub
9、【
简答题】
'提供给考生的程序
Private Sub Form_Unload(Cancel As Integer)
Open App.Path & "\out4.txt" For Output As #1
Print #1, Cb1.Text, Cb2.Text, CInt(L1.Font.Size), L1.Font
Close #1
End Sub
[10分]
解析:
'要求考生编写的程序
Private Sub Cb1_Click()
L1.Font.Size = Cb1.Text
End Sub
Private Sub Cb2_Click()
L1.Font = Cb2.Text
End Sub
10、【
简答题】
[10分]
解析:
Private Sub Text1_Change()
P1.Print Text1.Text 'Text1.Text前可以加Me或Form1
'或 Text1.Parent.P1.Print Text1.Text Text1.Text前可以加Me或Form1
'或 Me.P1.Print Text1.Text Text1.Text前可以加Me或Form1
'或 Form1.P1.Print Text1.Text Text1.Text前可以加Me或Form1
End Sub