From 5eac7a03c12110a07056dc443e0d5a932b570ec4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=AA=E6=83=B3=E5=B9=B2=E9=A5=AD?= <2923443262@qq.com> Date: Thu, 6 Jun 2024 11:19:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4603=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../circle.jsp" | 9 ++++++++ .../ladder.jsp" | 14 +++++++++++ .../main.jsp" | 23 +++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 "work/com/java/minxi/java_20240603/java_2301\351\237\246\345\212\233\350\216\211_2344310139/circle.jsp" create mode 100644 "work/com/java/minxi/java_20240603/java_2301\351\237\246\345\212\233\350\216\211_2344310139/ladder.jsp" create mode 100644 "work/com/java/minxi/java_20240603/java_2301\351\237\246\345\212\233\350\216\211_2344310139/main.jsp" diff --git "a/work/com/java/minxi/java_20240603/java_2301\351\237\246\345\212\233\350\216\211_2344310139/circle.jsp" "b/work/com/java/minxi/java_20240603/java_2301\351\237\246\345\212\233\350\216\211_2344310139/circle.jsp" new file mode 100644 index 00000000..0a944033 --- /dev/null +++ "b/work/com/java/minxi/java_20240603/java_2301\351\237\246\345\212\233\350\216\211_2344310139/circle.jsp" @@ -0,0 +1,9 @@ +<%@ page contentType="text/html" pageEncoding="utf-8" %> +<% + double radius = Double.parseDouble(request.getParameter("radius")); + double area = Math.PI * radius * radius; +%> + +
圆的半径是:<%= radius %>
+ 圆的面积(保留2位小数):<%= String.format("%.2f", area) %> +

diff --git "a/work/com/java/minxi/java_20240603/java_2301\351\237\246\345\212\233\350\216\211_2344310139/ladder.jsp" "b/work/com/java/minxi/java_20240603/java_2301\351\237\246\345\212\233\350\216\211_2344310139/ladder.jsp" new file mode 100644 index 00000000..8590fb4e --- /dev/null +++ "b/work/com/java/minxi/java_20240603/java_2301\351\237\246\345\212\233\350\216\211_2344310139/ladder.jsp" @@ -0,0 +1,14 @@ +<%@ page contentType="text/html" pageEncoding="utf-8" %> +<% + double upperBase = Double.parseDouble(request.getParameter("upperBase")); + double lowerBase = Double.parseDouble(request.getParameter("lowerBase")); + double height = Double.parseDouble(request.getParameter("height")); + double area = 0.5 * (upperBase + lowerBase) * height; +%> + + +
梯形的上底是:<%= upperBase %>
+ 梯形的下底是:<%= lowerBase %>
+ 梯形的高是:<%= height %>
+ 梯形的面积(保留2位小数):<%= String.format("%.2f", area) %> +

\ No newline at end of file diff --git "a/work/com/java/minxi/java_20240603/java_2301\351\237\246\345\212\233\350\216\211_2344310139/main.jsp" "b/work/com/java/minxi/java_20240603/java_2301\351\237\246\345\212\233\350\216\211_2344310139/main.jsp" new file mode 100644 index 00000000..cb833fba --- /dev/null +++ "b/work/com/java/minxi/java_20240603/java_2301\351\237\246\345\212\233\350\216\211_2344310139/main.jsp" @@ -0,0 +1,23 @@ +<%@ page pageEncoding="utf-8" %> + + +<% + double radius = 5.0; + double upperBase = 8.0; + double lowerBase = 10.0; + double height = 6.0; +%> + +
计算圆和梯形的面积 + + + + + + + + + +

+ + -- Gitee