Shape.cs 561 B

1234567891011121314151617181920212223242526272829303132
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace Shapes
  7. {
  8. public abstract class Shape
  9. {
  10. public abstract double Perimeter();
  11. }
  12. public class Circle : Shape
  13. {
  14. public Circle()
  15. {
  16. }
  17. public Circle(double radius)
  18. {
  19. Radius = radius;
  20. }
  21. public double Radius { get; set; }
  22. public override double Perimeter()
  23. {
  24. return Math.PI*Math.Pow(Radius, 2);
  25. }
  26. }
  27. }