Wednesday, August 4, 2010

answers to final 1

Sub Btn_Click(...)
    Dim T(3) aS Integer = { 1, 4, 6, 8}
    Mystery(T, 3)
End Sub

Sub NumbersInSequence(ByVal I as Integer, _
            ByVal J as Integer)
    For T = I to J
        lstBox.Items.Add(T)
    Next
End Sub

Sub PrintUntil7(ByVal A() As Integer)
    For Each x in A
        Debug.Print(x)
        if x = 7 then exit for
    Next
End Sub

Sub PrintUntil7(ByVal A() As Integer)
    For I = 0 to UBound(A)
        Debug.Print(A(I))
        if A(I) = 7 then exit for
    Next
End Sub

Sub PrintUntil7(ByVal A() As Integer)
    I = 0
    Do
        Debug.Print(A(I))
    While A(I) <> 7
End Sub

letter = txtBox.Text
Select Case letter.ToUpper
    Case "A"
        Debug.Print("apple")
    Case "B"
        Debug.Print("baseball")
    Case "C"
        Debug.Print("cow")
    Case "D"
        Debug.Print("debug")
End Select

No comments:

Post a Comment