diff --git a/res/lab1_decorator/ex1.png b/res/lab1_decorator/ex1.png new file mode 100644 index 0000000..6ef181d Binary files /dev/null and b/res/lab1_decorator/ex1.png differ diff --git a/res/lab1_decorator/ex2.png b/res/lab1_decorator/ex2.png new file mode 100644 index 0000000..65fa1f2 Binary files /dev/null and b/res/lab1_decorator/ex2.png differ diff --git a/src/lab1_decorator/ex2/Circle.java b/src/lab1_decorator/ex2/Circle.java index 480ffe0..69cf766 100644 --- a/src/lab1_decorator/ex2/Circle.java +++ b/src/lab1_decorator/ex2/Circle.java @@ -9,6 +9,6 @@ public class Circle extends Shape { @Override public void draw() { - System.out.println("Drawing a circle"); + System.out.printf("Drawing a circle of radius %fpx%n", radius); } } diff --git a/src/lab1_decorator/ex2/Rectangle.java b/src/lab1_decorator/ex2/Rectangle.java index 70497cb..02270bc 100644 --- a/src/lab1_decorator/ex2/Rectangle.java +++ b/src/lab1_decorator/ex2/Rectangle.java @@ -11,6 +11,6 @@ public class Rectangle extends Shape { @Override public void draw() { - System.out.println("Drawing a rectangle"); + System.out.printf("Drawing a rectangle of width %fpx and height %fpx%n", width, height); } } diff --git a/src/lab1_decorator/ex2/Square.java b/src/lab1_decorator/ex2/Square.java index b95d675..a0cc21b 100644 --- a/src/lab1_decorator/ex2/Square.java +++ b/src/lab1_decorator/ex2/Square.java @@ -9,6 +9,6 @@ public class Square extends Shape { @Override public void draw() { - System.out.println("Drawing a square"); + System.out.printf("Drawing a square of size %fpx%n", size); } }