L
ludasky
Guest
hi all,
Im writing a geometric code using inheriting class. so far ive done this. I can code the radius entered by the user but i cant figure out how to code with the HEIGHT part for the volume of the cylinder. I cant use ByVal ??
Option Explicit On
Option Strict On
Public Class Cylinder
Inherits GeometricShape
Private _radius As Decimal
Sub New(ByVal theRadius As Decimal)
Radius = theRadius
MyBase.Volume = CalculationVolume()
End Sub
End Property
Public Property Radius() As Decimal
Get
Return _radius
End Get
Set(ByVal value As Decimal)
_radius = value
End Set
End Property
Overrides Function CalculationVolume() As Decimal
Return Convert.ToDecimal(Math.PI * Height * Radius * Radius)
End Function
End Class
Im writing a geometric code using inheriting class. so far ive done this. I can code the radius entered by the user but i cant figure out how to code with the HEIGHT part for the volume of the cylinder. I cant use ByVal ??
Option Explicit On
Option Strict On
Public Class Cylinder
Inherits GeometricShape
Private _radius As Decimal
Sub New(ByVal theRadius As Decimal)
Radius = theRadius
MyBase.Volume = CalculationVolume()
End Sub
End Property
Public Property Radius() As Decimal
Get
Return _radius
End Get
Set(ByVal value As Decimal)
_radius = value
End Set
End Property
Overrides Function CalculationVolume() As Decimal
Return Convert.ToDecimal(Math.PI * Height * Radius * Radius)
End Function
End Class

