第五周作业
任务一、教材P39实验3
<%@ 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> <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>
<%@ 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=pink> <embed src="english/english.mp3" autostart=false> 课文音频 </embed> </body> </html>
任务二、教材P45 8题
提示:圆形面积需要一个param 梯形面积需要3个param,可以参考教材例2-11
<%@ 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" 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> <% double r = (int) (Math.random() * 10) + 1; if (r % 2 == 0) { %> <jsp:forward page="ou.jsp"> <jsp:param value="<%=r%>" name="num" /> </jsp:forward> <% } else { %> <jsp:forward page="ji.jsp"> <jsp:param value="<%=r%>" name="num" /> </jsp:forward> <% } %> </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("num"); out.print("Hello,我是一个偶数" + r); %> </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("num"); out.print("Hello,我是一个偶数" + r); %> </body> </html>