Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main;
- import figury.Prostokat;
- import figury.Kolo;
- import figury.Trojkat;
- public class Testowa {
- public static void main(String[] args) {
- Prostokat p1;
- Prostokat p2;
- Kolo k1;
- Kolo k2;
- Trojkat t1;
- Trojkat t2;
- //Tworzenie prostokatow
- p1 = new Prostokat();
- p2 = new Prostokat(0, 0, 2, 0, 2, 2, 0, 2);
- k1 = new Kolo();
- k2 = new Kolo(2,2,5);
- t1 = new Trojkat();
- t2 = new Trojkat (-2,4,6,2,0,-5);
- //Obliczenie pola
- System.out.println("Pole p1 to: " + p1.podajPole());
- System.out.println("Pole p2 to: " + p2.podajPole());
- System.out.println("Pole k1 to: " + k1.podajPole());
- System.out.println("Pole k2 to: " + k2.podajPole());
- System.out.println("Pole t1 to: " + t1.podajPole());
- System.out.println("Pole t2 to: " + t2.podajPole());
- //Wyrysowanie figur
- p1.rysuj();
- p2.rysuj();
- k1.rysuj();
- k2.rysuj();
- t1.rysuj();
- t2.rysuj();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement