/* * Copyright (C) 2016 PTM * * Object Oriented Programming Course Example File. * * Created: 22/01/2016 * Authors: Pasi Manninen */ using System; namespace T4 { /// /// Rectangle class is one of the used shapes in this app. /// class Rectangle : Shape { public double Width { get; set; } public double Height { get; set; } public override double Area { get { return Width * Height; } } public override double Circumference { get { return 2 * Width + 2 * Height; } } public override string ToString() { return String.Format("{0} Width={1} Height={2} Area={3:F2} Circumference={4:F2}", base.Name, Width, Height, Area, Circumference); } } }