Class Shapes VB.Net Exercise - Visual Basic Programming Course


 Exercise

Class Shapes

Objetive

Create a project and the corresponding classes (using several files) for this classes diagram.

Code

Imports System
Namespace shapes
    Class Circle
        Inherits Shape

        Protected radius As Double
    End Class
End Namespace

Namespace shapes
    Class Location
        Private x, y As Double
    End Class
End Namespace

Namespace shapes
    Class Rectangle
        Inherits Shape

        Protected side1, side2 As Double
    End Class
End Namespace

Namespace shapes
    Class Shape
        Protected c As Location

        Public Function ToString() As String
            Return ""
        End Function

        Public Function Area() As Double
            Return 0.000
        End Function

        Public Function Perimeter() As Double
            Return 0.000
        End Function
    End Class
End Namespace

Namespace shapes
    Class TestShape
        Private Shared Sub Main(ByVal args As String())
        End Sub
    End Class
End Namespace


Juan A. Ripoll - Systems Tutorials and Programming Courses © 2024 All rights reserved.  Legal Conditions.