Advertisement
Guest User

Class Kolo

a guest
May 21st, 2018
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.64 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4.  
  5. namespace Figury_polimorfizm
  6. {
  7.     class Kolo :  Figura
  8.     {
  9.         protected double r;
  10.  
  11.         public Kolo(double rr)
  12.         {
  13.             r = rr;
  14.         }
  15.  
  16.         public override double Skaluj(double a)
  17.         {
  18.             return r *= a;
  19.         }
  20.         public override double Pole()
  21.         {
  22.             return 3.14 * r * r;
  23.         }
  24.         public override double Obwod()
  25.         {
  26.             return 2 * 3.14 * r;
  27.         }
  28.         public override void Wyswietl()
  29.         {
  30.             Console.WriteLine("Koło r = " + r);
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement