Here's what I came up with. There's some extra stuff in there that you probably don't need (related to color, ignitionshape, etc.), but this demonstrates how to create the engine class and "tie" it to the car class:
<script runat=server language=
vb>
Public Class Engine
Private _SerialNum as Integer
Private _RPM as Integer
Private _EngineName as String
Private _IsOn as Boolean
Public ReadOnly Property SerialNum as Integer
Get
Return _SerialNum
End Get
End Property
Public ReadOnly Property RPM as Integer
Get
Return _RPM
End Get
End Property
Public ReadOnly Property EngineName as String
Get
Return _EngineName
End Get
End Property
Public ReadOnly Property IsRunning as String
Get
If _IsOn then
Return "The engine is running."
Else
Return "The engine is not running."
End If
End Get
End Property
Public Sub SwitchOn()
_IsOn = true
End Sub
Public Sub SwitchOff()
_IsOn = False
End Sub
Public Sub New()
_SerialNum = 12223
_RPM = 130
_EngineName = "Ferrari 350"
End Sub
End Class
Public Class Car
Private _Color as String
Private _IgnitionShape as Integer
'This section ties the Engine Class to the Car class
Private _Engine as Engine
Public Property MyEngine as Engine
Get
Return _Engine
End Get
Set
_Engine = value
End Set
End Property
Public Property Color as string
get
Return _Color
End Get
Set(value as String)
_Color = value
End Set
End Property
Public Property IgnitionShape as Integer
get
Return _IgnitionShape
End Get
Set(value as Integer)
_IgnitionShape = value
End Set
End Property
Sub New(newIgnitionShape as Integer)
_IgnitionShape = newIgnitionShape
_Color = "cold grey steel"
End Sub
end Class
Sub Page_Load()
Dim MyCar as New Car(131233123)
MyCar.MyEngine = New Engine()
Response.write("<br><br><b>New object 'MyCar' created.</b>")
Response.write("<br>Color: " & MyCar.Color)
Response.write("<br>Ignition Shape: " & MyCar.IgnitionShape)
Response.write("<br>" & MyCar.MyEngine.IsRunning)
MyCar.MyEngine.SwitchOn
Response.write("<br>" & MyCar.MyEngine.IsRunning)
Response.write("<br>Serial Num: " & MyCar.MyEngine.SerialNum)
Response.write("<br>RPM: " & MyCar.MyEngine.RPM)
Response.write("<br>Name: " & MyCar.MyEngine.EngineName)
End Sub
</script>
<body>
</body>