第五次作业

1.任务一、教材P39实验3

listenEnglish.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>listenEnglish</title>
</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="audio.jsp"/>
</p>
</body>
</html>
 
audio.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>audio</title>
</head>
<body bgcolor=pink>
<embed src="English/english.mp3"autostart=false>
课文音频
</embed>
</body>
</html>

 

 任务二、教材P45  8题

<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
</head>
<body bgcolor=cyan>

    <p style="font-family: 宋体; font-size: 36">
        <jsp:include page="circle.jsp">
            <jsp:param name="r" value=" 3" />
        </jsp:include>
    <p style="font-family: 宋体; font-size: 36">
        <jsp:include page="ladder.jsp">
            <jsp:param name="shang" value="2" />
            <jsp:param name="xia" value=" 4" />
            <jsp:param name="gao" value="2" />
        </jsp:include>
</body>
</html>



<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
</head>
<body>
    圆形面积为
    <%
    String r = request.getParameter("r");
    double r1 = Double.parseDouble(r);
    double area = 3.14 * r1 * r1;
    out.print(area);
%>
</body>
</html>

<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
</head>
<body>
    梯形面积为
    <%
    String shang = request.getParameter("shang");
    String xia = request.getParameter("xia");
    String gao = request.getParameter("gao");
    double shang1 = Double.parseDouble(shang);
    double xia1 = Double.parseDouble(xia);
    double gao1 = Double.parseDouble(gao);
    double area = (shang1 + xia1) * gao1 / 2;
    out.print(area);
%>
</body>
</html>

 

任务三、

 

 

 

<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
</head>
<body>
    <table width="500px" height="500px" border="1" bordercolor="blue"
        align="center">
        <tr>
            <td colspan="2"><%@ include file="top.jsp"%></td>
        </tr>
        <tr>
            <td><%@ include file="left.jsp"%></td>
            <td><%@ include file="right.jsp"%></td>
        </tr>
        <tr>
            <td colspan="2"><%@ include file="end.jsp"%></td>
        </tr>
    </table>
</body>
</html>


<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title> 这是top
</head>



<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title> 这是left
</head>




<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title> 这是right
</head>


<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title> 这是end
</head>

 

 任务四、

 


 

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
</head>
<body>
    <%
    int a = (int) (Math.random() * 10 + 1);
  if(a%2==0){
     %>
    <jsp:forward page="two.jsp">
    <jsp:param value="<%=a %>" name="a"/>
    </jsp:forward>
    <%}
    else{ %>
      <jsp:forward page="one.jsp">
    <jsp:param value="<%=a %>" name="a"/>
    </jsp:forward>
    <%} %>
</body>
</html>



<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
  <body>
    <%
     String a=request.getParameter("a");
    int a2=Integer.parseInt(a);
    out.print("我是生成的随机数:"+a2+",  hello,我是偶数");
    %>
  </body>
</html>

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>



  </head>
  
  <body>
    <%
    String a=request.getParameter("a");
    int a1=Integer.parseInt(a);
    out.print("我是生成的随机数:"+a1+",  hello,我是奇数");
     %>
  </body>
</html>

 

 

 
 

 

 
posted @ 2022-04-03 09:17  高杨翔  阅读(13)  评论(0编辑  收藏  举报