某Visual Basic程序如下: Private Sub Command1_Click( ?。?br />Dim a(1To 10)As Integer Dim i As Integer a(1)=1 For i=2To 8 a(i)=a(i-1)+i Next i Text1.Text=Str(a(5)) Text2.Text=Str(i) End Sub 該段程序運行時,單擊命令按鈕Command1,則: (1)文本框Text1中顯示的內容是
.(單選,填字母:A.Text1/B.List1/C.Command1/D.Judge/E.判斷) (2)為實現(xiàn)上述功能,請在橫線處填入合適的代碼. Private Sub Judge_Click( )Dim riqi As String,st As String Dim year As Integer,month As Integer,day As Integer Dim rn As Boolean,hefa As Boolean riqi=Text1.Text year=Val(Mid(riqi,1,4)) month=Val(Mid(riqi,5,2)) day=①
Then rn=True‘第②處 If year Mod 4=0And year Mod 100<>0Then rn=True hefa=True‘用于判斷是否為合法日期 If month=0Or month>12Then hefa=False If day=0Then hefa=False If (month=1Or month=3Or month=5Or month=7Or’與下一行語句同行 month=8Or month=10Or month=12)And day>31Then hefa=False If (month=4Or month=6Or month=9Or month=11)’與下一行語句同行 And day>30Then hefa=False If ③
Then hefa=False ’第③處,判斷閏年2月的天數(shù)是否合法 If month=2And Rn=False And day>28Then hefa=False If hefa=True Then st=st+“合法日期“Else st=st+“非法日期“ List1.AddItem st End Sub.