diff --git a/w5/AI学习报告.txt b/w5/AI学习报告.txt deleted file mode 100644 index e69de29..0000000 diff --git a/w5/Shape.java b/w5/Shape.java new file mode 100644 index 0000000..adc8984 --- /dev/null +++ b/w5/Shape.java @@ -0,0 +1,3 @@ +public abstract class Shape { + public abstract void draw(); +} \ No newline at end of file diff --git a/w5/ShapeCalculator.java b/w5/ShapeCalculator.java deleted file mode 100644 index 50fdd4b..0000000 --- a/w5/ShapeCalculator.java +++ /dev/null @@ -1,56 +0,0 @@ -package w5; - -public class ShapeCalculator { - abstract class Shape { - public abstract double getArea(); - } - class Circle extends Shape { - private double radius; - public Circle(double radius) { - this.radius = radius; - } - @Override - public double getArea() { - return Math.PI * radius * radius; - } - } - class Rectangle extends Shape { - private double width; - private double height; - public Rectangle(double width, double height) { - this.width = width; - this.height = height; - } - @Override - public double getArea() { - return width * height; - } - } - class Triangle extends Shape { - private double base; - private double height; - public Triangle(double base, double height) { - this.base = base; - this.height = height; - } - @Override - public double getArea() { - return 0.5 * base * height; - } - } - class ShapeUtil { - public static void printArea(Shape shape) { - System.out.println("图形面积为:" + shape.getArea()); - } - } - public static void main(String[] args) { - ShapeCalculator calculator = new ShapeCalculator(); - Shape circle = calculator.new Circle(5); - Shape rectangle = calculator.new Rectangle(4,6); - Shape triangle = calculator.new Triangle(3,8); - System.out.println("====== 图形面积计算器 ======"); - ShapeUtil.printArea(circle); - ShapeUtil.printArea(rectangle); - ShapeUtil.printArea(triangle); - } -} diff --git a/w5/~$ DOCX 文档.docx b/w5/~$ DOCX 文档.docx deleted file mode 100644 index bca0f96..0000000 Binary files a/w5/~$ DOCX 文档.docx and /dev/null differ diff --git a/w5/屏幕截图 2026-03-29 224240.png b/w5/屏幕截图 2026-03-29 224240.png deleted file mode 100644 index 02808fe..0000000 Binary files a/w5/屏幕截图 2026-03-29 224240.png and /dev/null differ diff --git a/w5/类图.jpg b/w5/类图.jpg deleted file mode 100644 index c5e2fee..0000000 Binary files a/w5/类图.jpg and /dev/null differ diff --git a/w5/组合与继承.docx b/w5/组合与继承.docx deleted file mode 100644 index bad5869..0000000 Binary files a/w5/组合与继承.docx and /dev/null differ