24.張某編寫了一個隨機生成彩票號碼的程序,程序運行界面如圖.程序功能:文本框TextSet用來錄入號碼生成數(shù)量,單擊“設(shè)置”按鈕(CommandSet)保存需要生成的號碼數(shù)量;單擊“開始生成”按鈕(CommandStart)后在列表框ListNum中顯示號碼;單擊“清除”按鈕清除生成的號碼. 程序代碼如下: Dim setNum As Integer Dim num(1To 100)As Integer Private Sub CommandClear_Click
ListNum.Clear'清除列表框內(nèi)容 End Sub Private Sub CommandSet_Click
setNum=Val(① ) End Sub Private Sub CommandStart_Click
Dim i As Integer If② Then MsgBox (“請先設(shè)置號碼生成數(shù)量“) Else Randomize For i=1To setNum num(i)=③ ListNum.AddItem num(i) Next i End If End Sub 請回答如下問題: (1)要對窗體標(biāo)題“Form1”進行更改,則在其屬性面板中設(shè)置的屬性名是
For i=3To 97① If f(i) And ② Then List1.AddItem Str(i)+“和“+Str(i+2) End If Next i
End Sub Private Function f(x As Integer) As Boolean'自定義函數(shù)f,返回值為邏輯型 Dim j As Integer f=True For j=2To Int(Sqr(x)) If x Mod j=0Then f=③'函數(shù)返回值 Exit For'跳出For循環(huán) End If Next j End Function (1)程序中加框部分的算法是