View Single Post
  #9 (permalink)  
Old 07-07-2009, 11:14 PM
subaru_sti subaru_sti is offline
VB.NET Forum Newbie
.NET Framework: .NET 2.0 (VS 2005)
 
Join Date: Jul 2009
Posts: 27
Reputation: 11
subaru_sti is on a distinguished programming path ahead
Default

Okay. I think this makes sense, to me anyways:

Code:
Namespace GPS
    Public Class Speed
        Private _metersPerSecond As Double

        Public Sub New(ByVal metersPerSecond As Double)
            Me.MetersPerSecond = metersPerSecond
        End Sub

        Public Property MetersPerSecond() As Double
            Get
                Return _metersPerSecond
            End Get
            Set(ByVal value As Double)
                If value < 0 Then Throw New ArgumentOutOfRangeException("Speed cannot be less than 0.")

                _metersPerSecond = value
            End Set
        End Property
    End Class
End Namespace
Stephen
Reply With Quote