diff --git "a/work/com/java/minxi/java_20240531/java_2302-\346\235\216\345\260\221\350\275\251_2344310239/work1.jsp" "b/work/com/java/minxi/java_20240531/java_2302-\346\235\216\345\260\221\350\275\251_2344310239/work1.jsp" new file mode 100644 index 0000000000000000000000000000000000000000..30bbf9df9c5f113a8f150b121bb15f4e9661a6aa --- /dev/null +++ "b/work/com/java/minxi/java_20240531/java_2302-\346\235\216\345\260\221\350\275\251_2344310239/work1.jsp" @@ -0,0 +1,39 @@ +<%-- + Created by IntelliJ IDEA. + User: Administrator + Date: 2024-06-18 + Time: 19:15 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Title + + +<%! public class Animals{ + String sleep(int time){ + return "一只动物在睡觉"; + } +} %> +<%! public class Cat{ + String name; + int time; + String sleep(int time){ + return "一只汤姆猫睡觉睡了8个小时"; + } + +} %> +<% Animals animals =new Animals(); + Cat cat =new Cat(); + cat.name="汤姆猫"; + System.out.println(animals.sleep(0)); + System.out.println(cat.sleep(8)); +%> +<% for (int i = 1; i <=9 ; i++) { + for (int j = 1; j +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Title + + +<% double a = 2; + double b = 3; + double c = 4; + double d = 5; +%> +

计算圆的面积

+
加载circle.jsp 计算半径<%=a%>圆的面积 + + + + +

计算梯形的面积

+
加载ladder.jsp 计算半径<%=b%>,<%=c%>,<%=d%>梯形的面积 + + + + + + + diff --git "a/work/com/java/minxi/java_20240605/java_2302_\346\235\216\345\260\221\350\275\251_2344310239/work2.jsp" "b/work/com/java/minxi/java_20240605/java_2302_\346\235\216\345\260\221\350\275\251_2344310239/work2.jsp" new file mode 100644 index 0000000000000000000000000000000000000000..e799dafb51bf1a0212036600ad12437815ad7f12 --- /dev/null +++ "b/work/com/java/minxi/java_20240605/java_2302_\346\235\216\345\260\221\350\275\251_2344310239/work2.jsp" @@ -0,0 +1,26 @@ +<%-- + Created by IntelliJ IDEA. + User: Administrator + Date: 2024-06-18 + Time: 19:17 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Title + + +<% + String SideA = request.getParameter("SideA"); + double a = Double.parseDouble(SideA); + +%> +<%! public Double circle(Double a){ + return Math.PI*a*a; +}; +%> + +

圆形的面积为:

<%=circle(a)%> + + diff --git "a/work/com/java/minxi/java_20240605/java_2302_\346\235\216\345\260\221\350\275\251_2344310239/work3.jsp" "b/work/com/java/minxi/java_20240605/java_2302_\346\235\216\345\260\221\350\275\251_2344310239/work3.jsp" new file mode 100644 index 0000000000000000000000000000000000000000..5dbb0945b7f57e6b72e4e2527a455eb8450230af --- /dev/null +++ "b/work/com/java/minxi/java_20240605/java_2302_\346\235\216\345\260\221\350\275\251_2344310239/work3.jsp" @@ -0,0 +1,30 @@ +<%-- + Created by IntelliJ IDEA. + User: Administrator + Date: 2024-06-18 + Time: 19:22 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Title + + +<% + String SideB = request.getParameter("SideB"); + String SideC = request.getParameter("SideC"); + String SideD = request.getParameter("SideD"); + double b = Double.parseDouble(SideB); + double c = Double.parseDouble(SideC); + double d = Double.parseDouble(SideD); + +%> +<%! public Double ladder(Double b,Double c,Double d){ + return (b+c)*d/2; +}; +%> + +

梯形的面积为:

<%=ladder(b,c,d)%> + + diff --git "a/work/com/java/minxi/java_20240606/java_2302_\346\235\216\345\260\221\350\275\251_2344310239/work1.jsp" "b/work/com/java/minxi/java_20240606/java_2302_\346\235\216\345\260\221\350\275\251_2344310239/work1.jsp" new file mode 100644 index 0000000000000000000000000000000000000000..f7ab15c3e0ee1527b2ff77c568f8c0092b6682d1 --- /dev/null +++ "b/work/com/java/minxi/java_20240606/java_2302_\346\235\216\345\260\221\350\275\251_2344310239/work1.jsp" @@ -0,0 +1,81 @@ +<%-- + Created by IntelliJ IDEA. + User: Administrator + Date: 2024-06-18 + Time: 19:25 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Title + + +<%! + public class Userinfo{ + private int id; + private MysqlxDatatypes.Scalar.String userinfo; + private MysqlxDatatypes.Scalar.String userphone; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public MysqlxDatatypes.Scalar.String getUserinfo() { + return userinfo; + } + + public void setUserinfo(MysqlxDatatypes.Scalar.String userinfo) { + this.userinfo = userinfo; + } + + public MysqlxDatatypes.Scalar.String getUserphone() { + return userphone; + } + + public void setUserphone(MysqlxDatatypes.Scalar.String userphone) { + this.userphone = userphone; + } + + public Userinfo(int id, MysqlxDatatypes.Scalar.String userinfo, MysqlxDatatypes.Scalar.String userphone) { + this.id = id; + this.userinfo = userinfo; + this.userphone = userphone; + } + + public String Userdata(){ + return "Userinfo{" + + "id=" + id + + ", userInfo='" +userinfo + '\'' + + ", userPhone='" +userphone + '\'' + + '}'; + } + } + + public List JDBC() throws Exception { + List userinfo1=new ArrayList<>(); + String url="jdbc:mysql://localhost:3306/student?serverTimezone=Asia/Shanghai"; + String username="root"; + String password="123456"; + + DatabaseMetaData DriverManger = null; + Connection con=DriverManger.getConnection(); + + String sql="select id,user_name,user_phone from user_info"; + + Statement sta=con.createStatement(); + ResultSet res=sta.executeQuery(sql); + + res.close(); + sta.close(); + con.close(); + + return userinfo1; + } +%> + +