Advertisement
Eresor

Untitled

Oct 8th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.34 KB | None | 0 0
  1. abstract class Shape
  2. {
  3.     public abstract float Area();
  4. }
  5.  
  6. class Rectangle : Shape
  7. {
  8.     public float width;
  9.     public float height;
  10.  
  11.     public override float Area()
  12.     {
  13.         return width * heigth;
  14.     }
  15. }
  16.  
  17. class Circle : Shape
  18. {
  19.     public float radius;
  20.  
  21.     public override float Area()
  22.     {
  23.         return radius * radius * Mathf.PI;
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement