*

clsPetCare Code for Aggregation Mini-Lecture: Day 2

Option Explicit
Public Event PetCareAdvised(TypeCare As String)
Private mCareType As String
Private mPetType As String
Private mFood As String
Private mCleaner As String
Private mExercises As String
Private mAttentions As String
Private Sub Feed(sPetType As String)
    Select Case LCase(sPetType)
        Case Is = "cat"
            mFood = "Cat will need some chicken and some water"
        Case Is = "dog"
            mFood = "Dog will need something interesting off the counter and some water"
    End Select
End Sub
Private Sub Clean(sPetType As String)
    Select Case LCase(sPetType)
        Case Is = "cat"
            mCleaner = "Cat will lick itself clean"
        Case Is = "dog"
            mCleaner = "Dog will need a bath"
    End Select
End Sub
Private Sub Exercise(sPetType As String)
    Select Case LCase(sPetType)
        Case Is = "cat"
            mExercises = "Cat will need to play with bed mice or a catnip toy"
        Case Is = "dog"
            mExercises = "Dog will need to chase a ball and run"
    End Select
End Sub
Private Sub Attention(sPetType As String)
            mAttentions = sPetType & " will need to be petted a lot and made a fuss over"
End Sub
Public Property Get Food() As String
    Feed PetType
    Food = mFood
    Finished CareType
End Property
Public Property Get Cleaner() As String
    Clean PetType
    Cleaner = mCleaner
    Finished CareType
End Property
Public Property Get Exercises() As String
    Exercise PetType
    Exercises = mExercises
    Finished CareType

End Property
Public Property Get Attentions() As String
    Attention PetType
    Attentions = mAttentions
    Finished CareType
End Property

Public Property Get PetType() As String
    PetType = mPetType
End Property

Public Property Let PetType(ByVal vNewValue As String)
    mPetType = vNewValue
End Property
Private Sub Finished(sCareType As String)
    RaiseEvent PetCareAdvised(sCareType)
End Sub

Public Property Get CareType() As String
    CareType = mCareType
End Property

Public Property Let CareType(ByVal vNewValue As String)
    mCareType = vNewValue
End Property

Internet Content Rating Association

Alrak's Course Resources ©2002-2007 Karla Carter. All rights reserved. This material (including, but not limited to, Mini-lectures and Challenge Labs) may not be reproduced, displayed, modified or distributed without the express prior written permission of the copyright holder. For permission, contact Karla.