第5次作业

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>



<html> 
  <head>
  </head>
   <body bgcolor="cyan">
   <br>英文课本(English Text): </br>
  <p style="font-family: 宋体;font-size: 18;color: black">
  <jsp:include page="English/english.txt"/>
  <br>英文音频(English Audio): </br>
    <jsp:include page="index.jsp"/>
   </p>
  </body>
</html>

   </p>
  </body>
</html>

  

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>



<html>
  <head>
   
  </head>
  
  <body bgcolor = pink>
  <embed src="English/english.mp3" autostart = false>
  课文音频
  </embed>
    
  </body>
</html>

main.jsp:
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>main</title>
</head>
<body bgcolor=cyan>
<jsp:include page="circle.jsp">
<jsp:param value="3" name="r"/>
</jsp:include>
<jsp:include page="ladder.jsp">
<jsp:param value="3" name="a"/>
<jsp:param value="5" name="b"/>
<jsp:param value="2" name="h"/>
</jsp:include>
</body>
</html>
circle.jsp:
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>circle</title>
</head>
<body>
<%
String r=request.getParameter("r");
double R=Double.parseDouble(r);
double S=3.14*R*R;
out.print("圆的面积为"+S);
%>
</body>
</html>

  

ladder.jsp:
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>ladder</title>
</head>
<body>
<%
 String a =request.getParameter("a");
String b =request.getParameter("b");
String h =request.getParameter("h");
double A =Double.parseDouble(a);
double B =Double.parseDouble(b);
double H =Double.parseDouble(h);
double s=(A+B)*H/2;
out.print("梯形面积为"+s);
%>
</body>

work4.jsp:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>work4</title>
</head>
<body>
<% double i=(int)(Math.random()*10)+1;
        if(i%2==0){  
        %> 
        <jsp:forward page="work4_1.jsp">
        <jsp:param name="number" value="<%=i %>"/>
        </jsp:forward>        
        <% }
        else{%>
 <jsp:forward page="work4_2.jsp">
       <jsp:param name="number" value="<%=i %>"/>
        </jsp:forward>
         
        <% }
        %>
</body>
</html>
work4_1.jsp:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>work4_1</title>
</head>
<body bgcolor=cyan>
<p style ="font-family:宋体;font-size:36">
<% String s=request.getParameter("number");
out.println("hello,我是一个偶数!"+s);
%>
</p>
</body>
</html>

  

work4_2.jsp:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>work4_1</title>
</head>
<body bgcolor=cyan>
<p style ="font-family:宋体;font-size:36">
<% String s=request.getParameter("number");
out.println("hello,我是一奇数!"+s);
%>
</p>
</body>
</html>

 

posted @ 2022-04-03 12:02  咸鱼大佬  阅读(9)  评论(0编辑  收藏  举报