Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace zaadanie9
- {
- class Punkt
- {
- float x, y;
- Punkt()
- {
- x =
- y=
- }
- void przesun ( float x, float y)
- {
- this.x += x;
- this.y += y;
- }
- }
- class Figura : Punkt
- {
- protected Punkt Srodek;
- Figura()
- {
- Srodek = new Punkt;
- }
- Figura(Punkt p)
- {
- Srodek = p;
- }
- float Pole();
- float Obwod();
- float Skaluj();
- void move ( float x, float y)
- {
- }
- }
- class Kolo : Figura
- {
- float r;
- Kolo()
- {
- r=
- }
- Kolo(Punkt p, float rr)
- {
- r = rr;
- }
- float Pole()
- {
- return (float)Math.PI * (float)Math.Pow(r, 2);
- }
- float Obwod()
- {
- return 2 * (float)Math.PI * r;
- }
- void Skaluj()
- {
- }
- }
- class Kwadrat : Figura
- {
- float dlugosc;
- Kwadrat()
- {
- dlugosc =
- }
- Kwadrat(Punkt p, float a)
- {
- dlugosc = a;
- }
- float Pole()
- {
- return (float)Math.Pow(dlugosc, 2);
- }
- float Obwod()
- {
- return 4 * dlugosc;
- }
- void Skaluj()
- {
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- List<Figura> lista = new List<Figura>();
- float sumaObwodow=0;
- float sumaPol=0;
- for( int i=0;i<6;i++)
- {
- if( i%2==0)
- else
- }
- Console.WriteLine("Wartosci pol wynkoszÄ…: ");
- Console.WriteLine("Suma wszystkich pol=");
- Console.WriteLine("Suma wszytskich obwodow=");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement