i have two classes.. equipment and turbine
in the equipment class, i have a constructor method that takes as arguments the date of purchase (date), and equipment OEM number, equipment serial number, and equipment type (all strings) and uses those values to initialize the instance arguments. It should also increment the shared count property by 1, and set the initial book value.
Public Sub New(ByVal dop As Date, ByVal Eq_SNo As String, ByVal Eq_type As String, ByVal Eq_OEM_No As String)
locdateofpurchase = dop
locEquip_SN = Eq_SNo
locEquip_type = Eq_type
locEquip_OEM_no = Eq_OEM_No
loc_count = loc_count + 1
locbook_value = RandomClass.Next(100, 1000)
End Sub
and I have a Public method Depreciate(Amount as double) as double. This method reduces the current bookvalue by the specified amount, and returns the new book value as the method value. Check that amount is positive (>0)
Public Function Depreciate(ByVal Amount As Double) As Double
If (Amount > 0) Then
locbook_value = locbook_value - Amount
If locbook_value < 0 Then
RaiseEvent Woops()
End If
Return locbook_value
End If
End Function
I should inherit the "equipment" class with another class "turbine"
and the turbine class should have this following:
§ Shadow the constructor method to take an additional argument of NumberOfStages (integer) and Brand (enum). Set up the Brand as an enumerated data type with possible values BrandX, BrandY, and BrandZ.
§ Add an overloaded method Public method Depreciate(Amount as double). Same as prior Depreciate, except for tax reasons only 50% of the amount can be applied to reducing the book value.
Can anyone help out this, how can i include the additional arguments by shadowing the existing constructor method in the "Equipment" class
Thanks!
in the equipment class, i have a constructor method that takes as arguments the date of purchase (date), and equipment OEM number, equipment serial number, and equipment type (all strings) and uses those values to initialize the instance arguments. It should also increment the shared count property by 1, and set the initial book value.
Public Sub New(ByVal dop As Date, ByVal Eq_SNo As String, ByVal Eq_type As String, ByVal Eq_OEM_No As String)
locdateofpurchase = dop
locEquip_SN = Eq_SNo
locEquip_type = Eq_type
locEquip_OEM_no = Eq_OEM_No
loc_count = loc_count + 1
locbook_value = RandomClass.Next(100, 1000)
End Sub
and I have a Public method Depreciate(Amount as double) as double. This method reduces the current bookvalue by the specified amount, and returns the new book value as the method value. Check that amount is positive (>0)
Public Function Depreciate(ByVal Amount As Double) As Double
If (Amount > 0) Then
locbook_value = locbook_value - Amount
If locbook_value < 0 Then
RaiseEvent Woops()
End If
Return locbook_value
End If
End Function
I should inherit the "equipment" class with another class "turbine"
and the turbine class should have this following:
§ Shadow the constructor method to take an additional argument of NumberOfStages (integer) and Brand (enum). Set up the Brand as an enumerated data type with possible values BrandX, BrandY, and BrandZ.
§ Add an overloaded method Public method Depreciate(Amount as double). Same as prior Depreciate, except for tax reasons only 50% of the amount can be applied to reducing the book value.
Can anyone help out this, how can i include the additional arguments by shadowing the existing constructor method in the "Equipment" class
Thanks!