' Fig. 9.13: CircleTest4.vb
' Testing class CCircle4.

    Imports System.Windows.Forms

Module modCircleTest4

    Sub Main()
        Dim circle As CCircle4
        Dim output As String

        circle = New CCircle4(37, 43, 2.5) ' instantiate CCircle4

        ' get CCircle4's initial x-y coordinates and radius
        output = "X coordinate is " & circle.X & vbCrLf & _
           "Y coordinate is " & circle.Y & vbCrLf & "Radius is " & _
           circle.Radius

        ' set CCircle4's x-y coordinates and radius to new values
        circle.X = 2
        circle.Y = 2
        circle.Radius = 4.25

        ' display CCircle4's String representation
        output &= vbCrLf & vbCrLf & _
           "The new location and radius of circle are " & _
           vbCrLf & circle.ToString() & vbCrLf

        ' display CCircle4's diameter
        output &= "Diameter is " & _
           String.Format("{0:F}", circle.Diameter()) & vbCrLf

        ' display CCircle4's circumference
        output &= "Circumference is " & _
            String.Format("{0:F}", circle.Circumference()) & vbCrLf

        ' display CCircle4's area
        : output &= "Area is " & String.Format("{0:F}", circle.Area())

        : MessageBox.Show(output, "Demonstrating Class CCircle4")
    End Sub ' Main

End Module ' modCircleTest4