JSP第三次作业

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
String banJing = request.getParameter("banJing");
double r = Double.parseDouble(banJing);
double pai = 3.14;
out.print("圆的面积是"+pai*r*r);
%>
</body>
</html>

 

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
String a = request.getParameter("shang");
String b = request.getParameter("xia");
String c = request.getParameter("gao");
double shang = Double.parseDouble(a);
double xia = Double.parseDouble(b);
double gao = Double.parseDouble(c);
out.print("梯形面积为:" + ((shang + xia) * gao / 2));
%>
</body>
</html>

 

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<jsp:include page="circle.jsp">
<jsp:param name="banJing" value="2" />
</jsp:include>
<br>
<jsp:include page="ladder.jsp">
<jsp:param value="4" name="shang" />
<jsp:param value="7" name="xia" />
<jsp:param value="3" name="gao" />
</jsp:include>
</body>
</html>

 

posted @ 2020-03-24 11:16  TIpengjie  阅读(106)  评论(0编辑  收藏  举报