【正文】
五、編程題( 每題10分,共20分)(1) 編制判斷是否同時(shí)被17與37整除的Function過(guò)程。程序段如下:Private Sub Form_Click() Dim strInput As String*70 ‘輸入字符串Dim Code as String*70 ‘加密結(jié)果Dim strTemp As String*1 ‘當(dāng)前處理的字符 Dim i as IntegerDim Length As Integer ‘字符串長(zhǎng)度Dim iAsc As Integer ‘第i個(gè)字符的Ascii碼 【6】 i=1 Code=”” 【7】 Do While (i=【8】) 【9】 If (strTemp=”A” And strTemp=”Z”) Then iAsc=Asc(strTemp)+5 If iAscAsc(“Z”) Then iAsc=iAsc26 Code=Left$(Code,i1)+Chr$(iAsc) ElseIf (strTemp=”a” And strTemp=”z”) Then iAsc=Asc(strTemp)+5 If iAscAsc(“z”) Then iAsc=iAsc26 Code=Left$(Code,i1)+Chr$(iAsc) Else Code= Left$(Code,i1)+strTemp End If i=i+1 Loop 【10】End Sub四、讀程序?qū)懡Y(jié)果( 每題5分,共10分) (1) 下列程序當(dāng)文本框輸入“ABCD”四個(gè)字符時(shí),窗體顯示的:Private Sub Text1_change( )Print End Sub (2) 寫(xiě)出程序按下mand1鍵后運(yùn)行的結(jié)果Private Sub Command1_Click() Dim x as Integer Static y as Integer x=3 y=1 Call AA(y+1) Z%=bb(x) Print x,y,z End SubPrivate Sub AA(ByVal z As Integer) y=x+z End Sub Private Function BB(ByRef y As Integer) y=y+1 BB=X+y End Function五、編程題( 每題10分,共20分)(1) 編制判斷是否同時(shí)被17與37整除的Function過(guò)程。程序運(yùn)行界面