The Loan object is taking shape. Here you see the Loan object with stubs for the Initialize event and the Principal-Amount property.

' private class variables to hold property values

Dim mvPrincipalAmount As Variant

Dim mvlnterestRate As Variant

Dim mvLoanNumber As Variant

Dim mvTerm As Variant

Now you're ready to fill in the implementation details. First, let's knock out the initialization event procedure. Locate the Class_Initialize procedure and modify it so that it matches the following procedure.

Private Sub C1ass_Initia1ize()

' set default principal amount to 0 mvPrincipalAmount = 0

' set default interest rate to 8% annually mvlnterestRate = 0.08 ' set loan number to 0 mvLoanNumber = 0 ' set term to 0 mvLoanNumber = 0 End Sub

You may be surprised, but many times it only takes a line or two to implement each of those Property Let and Property Get procedures. Listing 11.3 shows the implementation of all of the Property procedures.

0 0

Post a comment