Module Module1

    Sub Main()
        ' create a new car object...
        Dim myCar As Car
        myCar = New Car()

        ' report the details...
        Console.WriteLine("Acceleration rate:" & _
            myCar.CalculateAccelerationRate)

        ' display the details of the car...
        DisplayCarDetails(myCar)

        ' set the Color property to "Red"...
        myCar.Color = "Red"

        ' show what the value of the property is...
        Console.WriteLine("My car is this color:")
        Console.WriteLine(myCar.Color)

        ' report the speed...
        Console.WriteLine("The car's speed is:")
        Console.WriteLine(myCar.Speed)

        ' accelerate...
        myCar.Accelerate(5)

        ' report the new speed...
        Console.WriteLine("The car's speed is now:")
        Console.WriteLine(myCar.Speed)
        ' report the number of doors...
        Console.WriteLine("The number of doors is:")
        Console.WriteLine(myCar.NumberOfDoors)

        ' try changing the number of doors to 1000...
        myCar.NumberOfDoors = 1000

        ' report the number of doors...
        Console.WriteLine("The number of doors is:")
        Console.WriteLine(myCar.NumberOfDoors)

        ' now try changing the number of doors to 2...
        myCar.NumberOfDoors = 2

        ' report the number of doors...
        Console.WriteLine("The number of doors is:")
        Console.WriteLine(myCar.NumberOfDoors)

        ' accelerate the car to 25mph...
        myCar.Accelerate(25)

        ' report whether or not the car is moving...
        If myCar.IsMoving = True Then
            Console.WriteLine("The car is moving.")
        Else
            Console.WriteLine("The car is not moving.")
        End If

        ' add a couple of blank lines
        Console.WriteLine()
        Console.WriteLine()

        ' create a new SportsCar object...
        Dim mySportsCar As SportsCar
        mySportsCar = New SportsCar()

        ' display the details of the sports car...
        DisplayCarDetails(mySportsCar)

        ' set the horsepower and weight (kg)...
        mySportsCar.HorsePower = 240
        mySportsCar.Weight = 1085

        ' report the details...
        Console.WriteLine("Acceleration rate:" & mySportsCar.CalculateAccelerationRate)

        ' report the details...
        Console.WriteLine("Sports Car Horsepower:" & mySportsCar.HorsePower)
        Console.WriteLine("Sports Car Weight:" & mySportsCar.Weight)
        Console.WriteLine("Power/weight:" & mySportsCar.GetPowerToWeightRatio)

        ' wait...
        Console.ReadLine()

    End Sub


    ' DisplayCarDetails - function that displays a car's details...
    Function DisplayCarDetails(ByVal myCar As Car)

        ' display the details of the car...
        Console.WriteLine("Color:" & myCar.Color)
        Console.WriteLine("Number of doors:" & myCar.NumberOfDoors)
        Console.WriteLine("Current speed:" & myCar.Speed)
        Console.WriteLine()

    End Function

End Module
