Class Shapes Learn programming C# Sharp

Lesson:

Object Oriented Programming


Exercise:

Class Shapes 58


Objetive:

Using Visual Studio, create a project and the corresponding classes (using several files) for this classes diagram.


Code:

using System;
namespace shapes
{
    class Circle : Shape
    {
        protected double radius;
    }
}

using System;
namespace shapes
{
    class Location
    {
        private double x, y;
    }
}

using System;
namespace shapes
{
    class Rectangle : Shape
    {
        protected double side1, side2;
    }
}

using System;
namespace shapes
{
    class Shape
    {
        protected Location c;

        public string ToString()
        {
            return "";
        }

        public double Area()
        {
            return 0.000;
        }

        public double Perimeter()
        {
            return 0.000;
        }
    }
}

using System;
namespace shapes
{
    class TestShape
    {
        static void Main(string[] args)
        {

        }
    }
}