SHARE
TWEET

Untitled

a guest Jan 20th, 2020 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace Kalucki4_5
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             Kwadrat kw = new Kwadrat(5);
  10.             Console.WriteLine(kw.ToString());
  11.         }
  12.     }
  13.  
  14.     public interface IFigura
  15.     {
  16.         int Obwod { get; }
  17.         int Pole { get; }
  18.     }
  19.  
  20.     public class Kwadrat : IFigura
  21.     {
  22.         private int dlBoku;
  23.  
  24.         public Kwadrat(int dlBoku)
  25.         {
  26.             this.dlBoku = dlBoku;
  27.         }
  28.  
  29.         public int Obwod
  30.         {
  31.             get => 4 * dlBoku;
  32.         }
  33.  
  34.         public int Pole
  35.         {
  36.             get => dlBoku * dlBoku;
  37.         }
  38.  
  39.         public override string ToString()
  40.         {
  41.             return "Kwadrat: " + dlBoku.ToString();
  42.         }
  43.     }
  44. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top