JSP 第三次作业

 

 

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">

  </head>
   
  <body>
    <jsp:include page="circle.jsp" flush="true">
    <jsp:param  name="right" value="5"/>
    </jsp:include>
    <br>
    <jsp:include page="ladder.jsp">
    <jsp:param value="2" name="shang"/>
    <jsp:param value="3" name="xia"/>
    <jsp:param value="1.5" name="high"/>
    </jsp:include>
     
  </body>
</html>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">

  </head>
   
  <body>
  <%
  String a=request.getParameter("right");
  double b=Double.parseDouble(a);
  double pi=3.14;
  out.print("圆的面积为:"+(pi*b*b));
   %>
  </body>
</html>

  

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
  </head>
   
  <body>
  <%
  String a=request.getParameter("shang");
  String b=request.getParameter("xia");
  String c=request.getParameter("high");
  double d=Double.parseDouble(a);
  double e=Double.parseDouble(b);
  double f=Double.parseDouble(c);
  out.print("梯形面积为:"+((d+e)*f/2));
   %>
    <br>
  </body>
</html>

  

posted on 2020-03-25 10:04  一股糖果味  阅读(153)  评论(0编辑  收藏  举报

导航