Monday, December 13, 2010

Final review

general format:

60 points of m/ch and short answer
40 points of programming (choose 4 of 5)
20 points of tracing

Tracing example:
from 6.1, q 5

focus on arrays and loops
a LITTLE on functions and subs
general knowledge from previous sections

review of second practice exam
m/ch:
1) c
2) c
3) b
4) b
5) a
6) d
2D arrays
Dim myVar(8, 8) As Double
81 slots
7.5 two dimensional arrays

7) a
8) c
9) c
10) c
11) c
12) a

Part III
1) Write a SubRoutine called NumbersInSequence that takes two integer parameters, I and J, and prints out all the numbers from I to J.
Sub NumbersInSequence(ByVal I as Integer, ByVal J as Integer)
    For K = I to J
        ListBox1.Items.Add(K)
    Next
End Sub

2)
Sub PrintUntilSeven(ByVal x() as Integer)
    For i = 0 to UBound(x)
        Debug.Print(x(i))
        If x(i) = 7 Then
            Exit For
        Endif
    Next
End Sub

Sub PrintUntilSeven(ByVal x() as Integer)
    For each t in x
        Debug.Print(t)
        If t = 7 Then
            Exit For
        Endif
    Next
End Sub


Sub PrintUntilSeven(ByVal x() as Integer)
    i = 0
    Do While x(i) <> 7
        Debug.Print(x(i))
    Loop
End Sub

Select Case letter
    Case "A"
        Debug.Print("Apple")
    Case "B"
        Debug.Print("Banana")
    Case "C"
        Debug.Print("Cookie")
    Case "D"
        Debug.Print("Deer")
End Select

No comments:

Post a Comment