請(qǐng)根據(jù)算法將下列程序補(bǔ)充完整. Function prime(a As Integer) As Boolean Dim j As Integer prime=True j=2 Do While prime And j<=a\2 If a Mod j=0Then prime=False Exit Do End If
Loop End Function Private Sub Command1_Click ( ) Dim i As Integer,a As Integer,b As Integer Dim count As Integer a=Val(Text1.Text) b=Val(Text2.Text) For i=a To b If
=True Then List1.AddItem Str(i) count=count+1 End If Next i Label1.Caption=“素?cái)?shù)共有“+Str(count)+“個(gè)!“ End Sub.
Dim ID As String'用于存放客戶卡號(hào) Dim total As Long'用于存放積分?jǐn)?shù) Dim sc As Long'VIP客戶人數(shù) Dim jf As Long'積分?jǐn)?shù) Private Sub Command1_Click ( ?。?br />Dim k As String'客戶卡號(hào) Dim q As Long'代金券額度 Dim i As Long k=Text1.Text For i=1To sc’順序查找 If ID(i)=k Then jf=total(i) cash(jf)=q’① Exit For End If Text2.Text=Str(jf) Label3.Caption=“您可換購(gòu)的代金券總額為:”+Str(q)+“元” Next i End If End Sub 'cash函數(shù)用于計(jì)算VIP客戶可換購(gòu)的代金券額度 Function cash(jf As Long) As Long If jf>=2000And jf<=20000Then Cash=jf\2000*10 ElseIf jf>20000And jf<=50000Then Cash=jf\2000*11 ElseIf jf>50000And jf<=100000Then Cash=jf\2000*12 ElseIf jf>100000And jf<=150000Then Cash=jf\2000*13 Else jf>150000Then’② Cash=jf\2000*14 End If End Function Private Sub Form_Load ( ?。?br />Dim conn As New ADODB.Connection,rs As New ADODB.Recordset Dim intSQL As Long conn.ConnectionString=“Provider=Microsoft.ACE.OLEDB.12.0;Data Source=“+App.Path+“\customer.jye.ai“ conn.Open intSQL=“SELECT score FROM Integral“ Set rs.ActiveConnection=conn rs.CursorType=adOpenStatic rs.Open intSQL sc=0 Do While Not rs.EOF sc=sc+1 total(sc)=rs.Fields(“score“) rs.MoveNext Loop rs.Close conn.Close Set rs=Nothing Set conn=Nothing End Sub (1)加框處①有錯(cuò),應(yīng)改為