diff --git a/w4/Circle.class b/w4/Circle.class new file mode 100644 index 0000000..a57ddad Binary files /dev/null and b/w4/Circle.class differ diff --git a/w4/Circle.java b/w4/Circle.java new file mode 100644 index 0000000..c87f39e --- /dev/null +++ b/w4/Circle.java @@ -0,0 +1,20 @@ +public class Circle extends Shape { + private double radius; + + public Circle(double radius) { + this.radius = radius; + } + + public double getRadius() { + return radius; + } + + public void setRadius(double radius) { + this.radius = radius; + } + + @Override + public double getArea() { + return Math.PI * radius * radius; + } +} \ No newline at end of file diff --git a/w4/Rectangle.class b/w4/Rectangle.class new file mode 100644 index 0000000..8601b1d Binary files /dev/null and b/w4/Rectangle.class differ diff --git a/w4/Rectangle.java b/w4/Rectangle.java new file mode 100644 index 0000000..4d1d1bb --- /dev/null +++ b/w4/Rectangle.java @@ -0,0 +1,30 @@ +public class Rectangle extends Shape { + private double width; + private double height; + + public Rectangle(double width, double height) { + this.width = width; + this.height = height; + } + + public double getWidth() { + return width; + } + + public void setWidth(double width) { + this.width = width; + } + + public double getHeight() { + return height; + } + + public void setHeight(double height) { + this.height = height; + } + + @Override + public double getArea() { + return width * height; + } +} \ No newline at end of file diff --git a/w4/Shape.class b/w4/Shape.class new file mode 100644 index 0000000..54a12cc Binary files /dev/null and b/w4/Shape.class differ