Class Colored Circle Learn programming C#



Lesson:

OOP Object Oriented Programming


Exercise:

Class Colored Circle


Objetive:

Expand the January 10th exercise (shapes + square), so that it can also store data about "Colored Circles":


Code:

using System;
namespace shapes
{
    class ColoredCircle : Circle
    {
        protected int color;
        public ColoredCircle()
        {

        }
        public ColoredCircle(double dX, double dY, double dRadius, int color)
        {
            this.dX = dX;
            this.dY = dY;
            this.dRadius = dRadius;
            this.color = color;
        }

        public void Move()
        {

        }

        public void Scale()
        {

        }

        public string ToString()
        {
            return "";
        }

        public int GetColor()
        {
            return 0;
        }

        public void SetColor(int newColor)
        {
            color = newColor;
        }

        public override double Area()
        {
            return 0;
        }
        public override double Perimeter()
        {
            return 0;
        }
    }
}



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