diff --git "a/work/com/java/minxi/java_20240531/java_2302_\346\210\264\345\244\251\346\210\220_2344310214/homework.jsp" "b/work/com/java/minxi/java_20240531/java_2302_\346\210\264\345\244\251\346\210\220_2344310214/homework.jsp" new file mode 100644 index 0000000000000000000000000000000000000000..e7f2b76147bd424e8c25ed2a849dcc50660ffcb2 --- /dev/null +++ "b/work/com/java/minxi/java_20240531/java_2302_\346\210\264\345\244\251\346\210\220_2344310214/homework.jsp" @@ -0,0 +1,61 @@ +<%-- + Created by IntelliJ IDEA. + User: Administrator + Date: 2024-05-31 + Time: 16:58 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Title + + +<%! + public class Animal { + public String sleep() { + return "一只动物在睡觉"; + } + } + + public class Cat { + private String name; + private int time; + + public Cat() { + } + + public Cat(String name) { + this.name = name; + } + + public String sleep(int time) { + return "一只" + name + "睡觉睡了" + time + "小时"; + } + } + + public static void test() { + System.out.println(); + } +%> + +<% + Animal animal = new Animal(); + Cat cat = new Cat("汤姆猫"); +%> + +<%=animal.sleep()%>
+<%=cat.sleep(8)%>

+ +<% + // 打印九九乘法表 + for (int i = 1; i <= 9; i++) { + for (int j = 1; j <= i; j++) { + out.print(i + "*" + j + "=" + i * j + "\t"); + } + out.print("
"); + } +%> + + + diff --git "a/work/com/java/minxi/java_20240605/java_2302_\346\210\264\345\244\251\346\210\220_2344310214/circle.jsp" "b/work/com/java/minxi/java_20240605/java_2302_\346\210\264\345\244\251\346\210\220_2344310214/circle.jsp" new file mode 100644 index 0000000000000000000000000000000000000000..2542602e4fb88ae9e21dca62c298e9401597313f --- /dev/null +++ "b/work/com/java/minxi/java_20240605/java_2302_\346\210\264\345\244\251\346\210\220_2344310214/circle.jsp" @@ -0,0 +1,28 @@ +<%-- + Created by IntelliJ IDEA. + User: Administrator + Date: 2024-06-05 + Time: 16:57 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Title + + +<%! + // 圆的半径 + double r; +%> +
+ <% + r = Double.parseDouble(request.getParameter("r")); + %> + 圆的半径: ${param.r}
+
+ 圆的面积:<%=r * r * Math.PI%> +
+ + + diff --git "a/work/com/java/minxi/java_20240605/java_2302_\346\210\264\345\244\251\346\210\220_2344310214/ladder.jsp" "b/work/com/java/minxi/java_20240605/java_2302_\346\210\264\345\244\251\346\210\220_2344310214/ladder.jsp" new file mode 100644 index 0000000000000000000000000000000000000000..5185963de69cd6d3c686561c71e7c00c0ea537b9 --- /dev/null +++ "b/work/com/java/minxi/java_20240605/java_2302_\346\210\264\345\244\251\346\210\220_2344310214/ladder.jsp" @@ -0,0 +1,36 @@ +<%-- + Created by IntelliJ IDEA. + User: Administrator + Date: 2024-06-05 + Time: 16:57 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Title + + +<%! + // 梯形的上底 + double topLine; + // 梯形的下底 + double baseLine; + // 梯形的高 + double height; +%> +
+ <% + topLine = Double.parseDouble(request.getParameter("topLine")); + baseLine = Double.parseDouble(request.getParameter("baseLine")); + height = Double.parseDouble(request.getParameter("height")); + %> + 梯形的上底:${param.topLine}
+ 梯形的下底:${param.baseLine}
+ 梯形的高:${param.height}
+
+ 梯形的面积:<%=(topLine + baseLine) * height / 2%> +
+ + + diff --git "a/work/com/java/minxi/java_20240605/java_2302_\346\210\264\345\244\251\346\210\220_2344310214/main.jsp" "b/work/com/java/minxi/java_20240605/java_2302_\346\210\264\345\244\251\346\210\220_2344310214/main.jsp" new file mode 100644 index 0000000000000000000000000000000000000000..60acc81fc94f715e4c8ac05878459c1964c6bdfc --- /dev/null +++ "b/work/com/java/minxi/java_20240605/java_2302_\346\210\264\345\244\251\346\210\220_2344310214/main.jsp" @@ -0,0 +1,23 @@ +<%-- + Created by IntelliJ IDEA. + User: Administrator + Date: 2024-06-05 + Time: 16:57 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Title + + + + + + + + + + + +