public Rectangle(Rectangle rectangle) : base(rectangle.Color) { //this.Color = rectangle.Color; this.width = rectangle.width; this.height = rectangle.height; }
public Rectangle(Rectangle A) : base(A.Color) { Color = A.Color; Width = A.Width; Height = A.Height; }
public static void Main(string[] args) { Shape s1 = new Rectangle("red", 4, 5); Console.WriteLine (s1); Shape s2 = new Triangle("blue", 4, 5); Console.WriteLine (s2); Shape s3 = new Rectangle(); Console.WriteLine (s3); Rectangle r1 = new Rectangle((Rectangle)s1); Console.WriteLine (r1); r1.Width=-5.0; r1.Height=15; Console.WriteLine (r1); Triangle t1 = new Triangle(); t1.Width=3; t1.Height=4; Console.WriteLine (t1); //Shape s4 = new Shape("green"); //Console.WriteLine (s4); Console.WriteLine ("Perimeter of s1: {0}",printPerimeter (s1)); Console.WriteLine ("Perimeter of s2: {0}",printPerimeter (s2)); Console.WriteLine ("Perimeter of s3: {0}",printPerimeter (s3)); Console.WriteLine ("Perimeter of r1: {0}",printPerimeter (r1)); Console.WriteLine ("Perimeter of t1: {0}",printPerimeter (t1)); }
public Rectangle(Rectangle cpy) { _width = cpy.Width; _height = cpy.Height; _color = cpy.Color; }
public static double printPerimeter(Rectangle s) { return s.getPerimeter(); }
public Triangle(Rectangle a) : base(a.color) { this.width = a.width; this.hight = a.hight; }
public Rectangle(Rectangle r) { Width = r.Width; Height = r.Height; _Color = r._Color; }
public Rectangle( Rectangle r) { _Color = r._Color; Width = r._Width; Height = r._Height; }
public Rectangle(Rectangle r1) : base(r1.Color) { width = r1.Width; height = r1.Height; }
public Rectangle(Rectangle r) : base(r.Color) { _Width = r._Width; _Height = r._Height; }
public Triangle(Rectangle R) : base(R.Color) { this.Width = R.Width; this.Height = R.Height; }
public Rectangle(Rectangle r) : base(r.color) { _Height = r._Height; _Width = r._Width; }
public Rectangle(Rectangle r) { _color = r._color; Width = r.Width; Height = r.Height; }
public Rectangle(Rectangle r) : base(r.Color) { Width = r.Width; Height = r.Height; }
public Rectangle(Rectangle r) : base(r.color) { _height = r._height; _width = r._width; }
public Triangle(Rectangle r) : base(r.color) { Width = r.Width; Height = r.Height; }
public Rectangle(Rectangle R) : base(R.color) { Width = R.Width; Height = R.Height; }
public Rectangle(Rectangle R) : base(R.Color) { _height = R.Height; _width = R.Width; }
public Rectangle(Rectangle s) { _color = s.Color; _width = s.Width; _height = s.Height; }