15.閱讀以下程序,完成后面的題目: Private Sub Command1_Click( ?。? Dim N As Integer Dim S As Integer N=val(Text1.Text) S=0 For i=1To N S=S+i*(i+1) Next i Text2.Text=str(S) End Sub (1)當(dāng)程序運行時,在Text1文本框中輸入4,單擊按鈕command1,結(jié)果在Text2輸出
(1)為了實現(xiàn)以上程序功能,使程序正常運行,請完善以下兩處代碼. Private Sub Command1_Click ( ) Dim dx As String,dw As String Dim s As String,c As String Dim ch As String Dim i As Integer dx=“零壹貳叁肆伍陸柒捌玖拾“ dw=“億仟佰拾萬仟佰拾元“ s=Text1.Text If Len(s)>9
Text2.Text=“輸入的數(shù)據(jù)超出所能轉(zhuǎn)換的范圍“ Else For i=1To Len(s) ch=
c=c+Mid(dx,Val(ch)+1,1)+Mid(dw,9-Len(s)+i,1) Next i Text2.Text=c+“整“ End If End Sub (2)由上述算法可知,若在文本框Text1中輸入“20”,則文本框Text3顯示的結(jié)果為