Shape.cs 637 B

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