Public Class UserControl1

    Private _years As Double

    Private _principle As Double

    Private _intRate As Double

    Private _Interest As Double

 

    Public Property years() As Double

        Get

            Return _years

        End Get

        Set(ByVal value As Double)

            _years = value

        End Set

    End Property

    Public Property principle() As Double

        Get

            Return _principle

        End Get

        Set(ByVal value As Double)

            _principle = value

        End Set

    End Property

    Public Property intRate() As Double

        Get

            Return _intRate

        End Get

        Set(ByVal value As Double)

            _intRate = value

        End Set

    End Property

    Public ReadOnly Property Interest() As Double

        Get

            Return _Interest

        End Get

    End Property

    Public Sub CalculateInterest(ByVal principle As Double, ByVal Years As Double, ByVal intRate As Double)

        _Interest = principle * _years * _intRate / 100

    End Sub

End Class