From 1f2efd5883263700ce60ab71ef086358bb830684 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=86=B6=E8=B1=AA?= <1033474650@qq.com> Date: Wed, 29 May 2024 12:10:05 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../person.java" | 31 ++++++++++ .../rectangle.java" | 40 +++++++++++++ .../jdbc1.java" | 35 +++++++++++ .../jdbc2.java" | 38 ++++++++++++ .../jdbc3.java" | 60 +++++++++++++++++++ 5 files changed, 204 insertions(+) create mode 100644 "work/com/java/minxi/java_20240522/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/person.java" create mode 100644 "work/com/java/minxi/java_20240522/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/rectangle.java" create mode 100644 "work/com/java/minxi/java_20240524/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/jdbc1.java" create mode 100644 "work/com/java/minxi/java_20240524/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/jdbc2.java" create mode 100644 "work/com/java/minxi/java_20240524/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/jdbc3.java" diff --git "a/work/com/java/minxi/java_20240522/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/person.java" "b/work/com/java/minxi/java_20240522/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/person.java" new file mode 100644 index 0000000..425488b --- /dev/null +++ "b/work/com/java/minxi/java_20240522/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/person.java" @@ -0,0 +1,31 @@ +package com.java.minxi.java_20240522.java_2302_吴憶豪_2244310224; + +public class person { + private String firstName; + private String lastName; + + public person(String firstName, String lastName) { + this.firstName = firstName; + this.lastName = lastName; + } + public void printFullName(){ + System.out.println(firstName+""+lastName); + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } +} + diff --git "a/work/com/java/minxi/java_20240522/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/rectangle.java" "b/work/com/java/minxi/java_20240522/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/rectangle.java" new file mode 100644 index 0000000..17b3764 --- /dev/null +++ "b/work/com/java/minxi/java_20240522/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/rectangle.java" @@ -0,0 +1,40 @@ +package com.java.minxi.java_20240522.java_2302_吴憶豪_2244310224; + +import java.util.Scanner; + +class Rectangle { + private double width; + private double height; + + public Rectangle(double width, double height) { + this.width = width; + this.height = height; + } + + public double getArea(){ + return width * height; + } + public double getPerimeter(){ + return 2*(width+height); + } +} +public class rectangle { + public static void main(String[] args) { + Scanner scanner = new Scanner(System.in); + + System.out.println("please add width:"); + double width = scanner.nextDouble(); + + System.out.println("please add height"); + double height = scanner.nextDouble(); + + Rectangle rectangle = new Rectangle(width, height); + + double area = rectangle.getArea(); + double perimeter = rectangle.getPerimeter(); + + System.out.println("area:" + area); + System.out.println("perimeter:" + perimeter); + + } +} \ No newline at end of file diff --git "a/work/com/java/minxi/java_20240524/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/jdbc1.java" "b/work/com/java/minxi/java_20240524/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/jdbc1.java" new file mode 100644 index 0000000..4cb0325 --- /dev/null +++ "b/work/com/java/minxi/java_20240524/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/jdbc1.java" @@ -0,0 +1,35 @@ +package com.java.minxi.java_20240524.java_2302_吴憶豪_2244310224; + +import java.sql.*; + +public class jdbc1 { + public static void main(String[] args) { + String url = "jdbc:mysql://locallhost:3306/root"; + String user = "username"; + String password = "password"; + + try { + Class.forName("com.java.minxi.java_20240524.java_2302_吴憶豪_2244310224.jdbc1.Driver"); + + System.out.println("link start"); + Connection conn = DriverManager.getConnection(url, user, password); + + System.out.println("select infomaion"); + Statement stmt = conn.createStatement(); + ResultSet rs = stmt.executeQuery("select id,teacher_name,teacher_age from users"); + + while (rs.next()) { + int id = rs.getInt("id"); + String teacher_name = rs.getString("name"); + System.out.println("id:" + id); + System.out.println("name:" + teacher_name); + } + rs.close(); + stmt.close(); + conn.close(); + } + catch(Exception e){ + e.printStackTrace(); + } + } +} diff --git "a/work/com/java/minxi/java_20240524/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/jdbc2.java" "b/work/com/java/minxi/java_20240524/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/jdbc2.java" new file mode 100644 index 0000000..b935141 --- /dev/null +++ "b/work/com/java/minxi/java_20240524/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/jdbc2.java" @@ -0,0 +1,38 @@ +package com.java.minxi.java_20240524.java_2302_吴憶豪_2244310224; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.PreparedStatement; +import java.sql.ResultSet; + +public class jdbc2 { + public static void main(String[] args) { + String url = "jdbc:mysql://localhost:3306/root"; + String user = "username"; + String password = "password"; + + String sql = "select * from users where id = ? and age = ?"; + try { + Class.forName("com.mysql.cj.jdbc.Driver"); + Connection conn = DriverManager.getConnection(url, user, password); + PreparedStatement pstmt = conn.prepareStatement(sql); + pstmt.setInt(1, 1); + pstmt.setInt(2, 35); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) { + int id = rs.getInt("id"); + String name = rs.getString("teacher_name"); + int age = rs.getInt("teacher_age"); + System.out.println("id:" + id + ",name:" + name + ",age" + age); + } + rs.close(); + pstmt.close(); + conn.close(); + } + catch (Exception e){ + e.printStackTrace(); + + } + } + } + diff --git "a/work/com/java/minxi/java_20240524/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/jdbc3.java" "b/work/com/java/minxi/java_20240524/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/jdbc3.java" new file mode 100644 index 0000000..908971d --- /dev/null +++ "b/work/com/java/minxi/java_20240524/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/jdbc3.java" @@ -0,0 +1,60 @@ +package com.java.minxi.java_20240524.java_2302_吴憶豪_2244310224; + +import java.io.File; +import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; + +public class jdbc3 { + public static void main(String[] args) { + Map druid = getConnectionData("druid"); + DruidDataSource dataSource = new DruidDataSource(); + dataSource.setUrl("jdbc:mysql://localhost:3306/root"); + dataSource.setUsername("username"); + dataSource.setPassword("password"); + dataSource.setDriverClassName("com.mysql.cj.jdbc.Driver"); + + try { + Connection connection = dataSource.getConnection(); + String sql = "UPDATE users SET username = ? WHERE id = ?"; + PreparedStatement statement = connection.prepareStatement(sql); + statement.setString(1, "小严"); + statement.setInt(2, 3); + + int affectedRows = statement.executeUpdate(); + + statement.close(); + connection.close(); + + if (affectedRows > 0) { + System.out.println("true"); + } else { + System.out.println("false"); + } + }catch(Exception e){ + e.printStackTrace(); + } + } + public static Map getConnectionData(String fileName) { + Map map = new HashMap<>(); + try { + Properties properties = new Properties(); + String property = System.getProperty("user.dir"); + File file = new File(property + "\\" + fileName + ".properties"); + InputStreamReader inputStreamReader = new InputStreamReader(Files.newInputStream(file.toPath()), StandardCharsets.UTF_8); + properties.load(inputStreamReader); + for (Object o : properties.keySet()) { + String key = (String) o; + String value = properties.getProperty(key); + map.put(key, value); + } + } catch (Exception e) { + e.printStackTrace(); + } + return map; +} -- Gitee From fd1b598ec3eb65cbc5644859f90dfa0f9273171a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=86=B6=E8=B1=AA?= <1033474650@qq.com> Date: Thu, 30 May 2024 20:09:59 +0800 Subject: [PATCH 2/5] =?UTF-8?q?0524=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jdbc3.java" | 69 +++++-------------- 1 file changed, 19 insertions(+), 50 deletions(-) diff --git "a/work/com/java/minxi/java_20240524/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/jdbc3.java" "b/work/com/java/minxi/java_20240524/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/jdbc3.java" index 908971d..1d992a2 100644 --- "a/work/com/java/minxi/java_20240524/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/jdbc3.java" +++ "b/work/com/java/minxi/java_20240524/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/jdbc3.java" @@ -1,60 +1,29 @@ package com.java.minxi.java_20240524.java_2302_吴憶豪_2244310224; -import java.io.File; -import java.io.InputStreamReader; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; +import com.alibaba.druid.pool.DruidDataSource; +import com.alibaba.druid.pool.DruidDataSourceFactory; + import java.sql.Connection; import java.sql.PreparedStatement; -import java.util.HashMap; -import java.util.Map; import java.util.Properties; public class jdbc3 { - public static void main(String[] args) { - Map druid = getConnectionData("druid"); - DruidDataSource dataSource = new DruidDataSource(); - dataSource.setUrl("jdbc:mysql://localhost:3306/root"); - dataSource.setUsername("username"); - dataSource.setPassword("password"); - dataSource.setDriverClassName("com.mysql.cj.jdbc.Driver"); - - try { - Connection connection = dataSource.getConnection(); - String sql = "UPDATE users SET username = ? WHERE id = ?"; - PreparedStatement statement = connection.prepareStatement(sql); - statement.setString(1, "小严"); - statement.setInt(2, 3); - - int affectedRows = statement.executeUpdate(); - - statement.close(); - connection.close(); + public static void main(String[] args) throws Exception { + Properties props = new Properties(); + props.put("url","jdbc:mysql://localhost:3306/your_database"); + props.put("username","your_name"); + props.put("password","your_password"); + props.put("driverClassName","com.mysql.cj.jdbc.Driver"); - if (affectedRows > 0) { - System.out.println("true"); - } else { - System.out.println("false"); - } - }catch(Exception e){ - e.printStackTrace(); - } + DruidDataSource dataSource = (DruidDataSource) DruidDataSourceFactory.createDataSource(props); + Connection connection = dataSource.getConnection(); + String sql = "UPDATE users SET username = ? WHERE id = ?"; + PreparedStatement statement = connection.prepareStatement(sql); + statement.setString(1,"小严"); + statement.setInt(2, 3); + int affectedRows = statement.executeUpdate(); + statement.close(); + connection.close(); + System.out.println("affectedRows:"+affectedRows); } - public static Map getConnectionData(String fileName) { - Map map = new HashMap<>(); - try { - Properties properties = new Properties(); - String property = System.getProperty("user.dir"); - File file = new File(property + "\\" + fileName + ".properties"); - InputStreamReader inputStreamReader = new InputStreamReader(Files.newInputStream(file.toPath()), StandardCharsets.UTF_8); - properties.load(inputStreamReader); - for (Object o : properties.keySet()) { - String key = (String) o; - String value = properties.getProperty(key); - map.put(key, value); - } - } catch (Exception e) { - e.printStackTrace(); - } - return map; } -- Gitee From 747651f7d42826e37c8b5c1ce284dc90e4db1bcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=86=B6=E8=B1=AA?= <1033474650@qq.com> Date: Thu, 30 May 2024 23:15:24 +0800 Subject: [PATCH 3/5] =?UTF-8?q?0524=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../person.java" | 31 -------------- .../rectangle.java" | 40 ------------------- 2 files changed, 71 deletions(-) delete mode 100644 "work/com/java/minxi/java_20240522/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/person.java" delete mode 100644 "work/com/java/minxi/java_20240522/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/rectangle.java" diff --git "a/work/com/java/minxi/java_20240522/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/person.java" "b/work/com/java/minxi/java_20240522/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/person.java" deleted file mode 100644 index 425488b..0000000 --- "a/work/com/java/minxi/java_20240522/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/person.java" +++ /dev/null @@ -1,31 +0,0 @@ -package com.java.minxi.java_20240522.java_2302_吴憶豪_2244310224; - -public class person { - private String firstName; - private String lastName; - - public person(String firstName, String lastName) { - this.firstName = firstName; - this.lastName = lastName; - } - public void printFullName(){ - System.out.println(firstName+""+lastName); - } - - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } -} - diff --git "a/work/com/java/minxi/java_20240522/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/rectangle.java" "b/work/com/java/minxi/java_20240522/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/rectangle.java" deleted file mode 100644 index 17b3764..0000000 --- "a/work/com/java/minxi/java_20240522/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/rectangle.java" +++ /dev/null @@ -1,40 +0,0 @@ -package com.java.minxi.java_20240522.java_2302_吴憶豪_2244310224; - -import java.util.Scanner; - -class Rectangle { - private double width; - private double height; - - public Rectangle(double width, double height) { - this.width = width; - this.height = height; - } - - public double getArea(){ - return width * height; - } - public double getPerimeter(){ - return 2*(width+height); - } -} -public class rectangle { - public static void main(String[] args) { - Scanner scanner = new Scanner(System.in); - - System.out.println("please add width:"); - double width = scanner.nextDouble(); - - System.out.println("please add height"); - double height = scanner.nextDouble(); - - Rectangle rectangle = new Rectangle(width, height); - - double area = rectangle.getArea(); - double perimeter = rectangle.getPerimeter(); - - System.out.println("area:" + area); - System.out.println("perimeter:" + perimeter); - - } -} \ No newline at end of file -- Gitee From dafb27ae37c63c769a1dd4a537c0212fd9bfaa3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=86=B6=E8=B1=AA?= <1033474650@qq.com> Date: Fri, 31 May 2024 05:53:48 +0000 Subject: [PATCH 4/5] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20work?= =?UTF-8?q?/com/java/minxi/java=5F20240522/java=5F2302=5F=E5=90=B4?= =?UTF-8?q?=E6=86=B6=E8=B1=AA=5F2244310224?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../person.java" | 31 -------------- .../rectangle.java" | 40 ------------------- 2 files changed, 71 deletions(-) delete mode 100644 "work/com/java/minxi/java_20240522/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/person.java" delete mode 100644 "work/com/java/minxi/java_20240522/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/rectangle.java" diff --git "a/work/com/java/minxi/java_20240522/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/person.java" "b/work/com/java/minxi/java_20240522/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/person.java" deleted file mode 100644 index 425488b..0000000 --- "a/work/com/java/minxi/java_20240522/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/person.java" +++ /dev/null @@ -1,31 +0,0 @@ -package com.java.minxi.java_20240522.java_2302_吴憶豪_2244310224; - -public class person { - private String firstName; - private String lastName; - - public person(String firstName, String lastName) { - this.firstName = firstName; - this.lastName = lastName; - } - public void printFullName(){ - System.out.println(firstName+""+lastName); - } - - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } -} - diff --git "a/work/com/java/minxi/java_20240522/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/rectangle.java" "b/work/com/java/minxi/java_20240522/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/rectangle.java" deleted file mode 100644 index 17b3764..0000000 --- "a/work/com/java/minxi/java_20240522/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/rectangle.java" +++ /dev/null @@ -1,40 +0,0 @@ -package com.java.minxi.java_20240522.java_2302_吴憶豪_2244310224; - -import java.util.Scanner; - -class Rectangle { - private double width; - private double height; - - public Rectangle(double width, double height) { - this.width = width; - this.height = height; - } - - public double getArea(){ - return width * height; - } - public double getPerimeter(){ - return 2*(width+height); - } -} -public class rectangle { - public static void main(String[] args) { - Scanner scanner = new Scanner(System.in); - - System.out.println("please add width:"); - double width = scanner.nextDouble(); - - System.out.println("please add height"); - double height = scanner.nextDouble(); - - Rectangle rectangle = new Rectangle(width, height); - - double area = rectangle.getArea(); - double perimeter = rectangle.getPerimeter(); - - System.out.println("area:" + area); - System.out.println("perimeter:" + perimeter); - - } -} \ No newline at end of file -- Gitee From c8a9cedd50eb8ff9b5fdb76a79efa59152a91f51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=86=B6=E8=B1=AA?= <1033474650@qq.com> Date: Thu, 6 Jun 2024 19:57:17 +0800 Subject: [PATCH 5/5] =?UTF-8?q?0531=E5=92=8C0605=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jsp.jsp" | 74 +++++++++++++++++++ .../circle.jsp" | 18 +++++ .../ladder.jsp" | 8 ++ .../main.jsp" | 25 +++++++ 4 files changed, 125 insertions(+) create mode 100644 "work/com/java/minxi/java_20240531/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/jsp.jsp" create mode 100644 "work/com/java/minxi/java_20240605/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/circle.jsp" create mode 100644 "work/com/java/minxi/java_20240605/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/ladder.jsp" create mode 100644 "work/com/java/minxi/java_20240605/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/main.jsp" diff --git "a/work/com/java/minxi/java_20240531/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/jsp.jsp" "b/work/com/java/minxi/java_20240531/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/jsp.jsp" new file mode 100644 index 0000000..7d6cc14 --- /dev/null +++ "b/work/com/java/minxi/java_20240531/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/jsp.jsp" @@ -0,0 +1,74 @@ +package com.java.minxi.java_20240530.java_2302_吴憶豪_2244310224; + +import static java.lang.System.out; +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> + + + + title + + + +<%! +//定义一个Animal类,并在类中定义一个String sleep(int time)的成员方法 + + public class Animal { +public String sleep(int time) { +return "一只动物在睡觉"; +} +} + +//定义一个Cat类,包含name及time的属性,并定义String sleep(int time)的方法 +public class Cat { +private String name; +private int time; + +public Cat(String name, int time) { +this.name = name; +this.time = time; +} +public String getName() { +return name; +} + +public void setName(String name) { +this.name = name; +} + +public int getTime() { +return time; +} + +public void setTime(int time) { +this.time = time; +} + +public String sleep(int time){ +return"一只"+this.name+"睡觉睡了"+time+"小时"; +} +} %> + +<% Animal animal = new Animal(); +String sleep = animal.sleep(0); +out.println(sleep); + +Cat cat = new cat(); +cat.setName("汤姆猫"); +String sleep1 = animal.sleep(8); +out.println(sleep1); +%> + + +<% for (int i =1;i<=9;i++){ %> + + <% for(int j=1;j<=i;j++){ %> + + <%}%> + + <%}%> +
+ <% out.println(i+"*"+j+"="+i*j);%> +
+ + +} diff --git "a/work/com/java/minxi/java_20240605/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/circle.jsp" "b/work/com/java/minxi/java_20240605/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/circle.jsp" new file mode 100644 index 0000000..3fe13c3 --- /dev/null +++ "b/work/com/java/minxi/java_20240605/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/circle.jsp" @@ -0,0 +1,18 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> + + + + title + + + + <% + String radius = request.getParameter("radius"); + double r = double.getParameter("radius"); + double area = Math.PI*r*r; + %> +

The radius <%= raidus%> of area is:<%= area%>

+ + + + diff --git "a/work/com/java/minxi/java_20240605/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/ladder.jsp" "b/work/com/java/minxi/java_20240605/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/ladder.jsp" new file mode 100644 index 0000000..9c57edc --- /dev/null +++ "b/work/com/java/minxi/java_20240605/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/ladder.jsp" @@ -0,0 +1,8 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> +<% + double top = double.parseDouble(request.getParameter("top")); + double bottom = double.parseDobule(request.getParameter("bottom")); + double height = Double.parseDouble(request.getParameter("height")); + double area = ((top+bottom)/2)* height; +%> +

The ladder top <%=top%>,bottom<%=bottom%>and height<%=height%>is:<%=area%>

\ No newline at end of file diff --git "a/work/com/java/minxi/java_20240605/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/main.jsp" "b/work/com/java/minxi/java_20240605/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/main.jsp" new file mode 100644 index 0000000..64e47e0 --- /dev/null +++ "b/work/com/java/minxi/java_20240605/java_2302_\345\220\264\346\206\266\350\261\252_2244310224/main.jsp" @@ -0,0 +1,25 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> + + + + + main + + + +
circle area:
+ top:
+ bottom:
+ height:
+
+ + + + + + + + + + + \ No newline at end of file -- Gitee