第6作业

%@ 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>
<style type="text/css">
textarea {
    overflow-y: auto;
}
 
#zc {
    
    width: 300px;
}
 
#bz {
    float: right;
}
 
.t {
    float: left;
    width: 120px;
    text-align: center;
    text-align-last: justify;
}
 
#y {
    width: 40px;
}
</style>
</head>
<body>
    <img src="img/bd.png">
    <div id="zc">
        <span id="yhzc">用户注册</span> <span id="bz"> <a id="">帮助</a>
        </span>
    </div>
    <form action="jies.jsp" method="post">
        <span class="t">用户名:</span> <input type="text" name="yhm" />只能输入字母或数字,4-16个字符
        <br /> <span class="t">密码:</span> <input type="password" name="mm" />密码长度6-12位
        <br /> <span class="t">确认密码:</span> <input type="password"
            name="qrmm" /> <br /> <span class="t">性别:</span> <input
            type="radio" name="xb" value="" checked="checked" />男 <input
            type="radio" name="xb" value="" />女 <br /> <span class="t">电子邮件地址:</span>
        <input type="email" name="dzyj" />请输入正确的Email地址 <br /> <span
            class="t">出生日期:</span> <input id="y" type="text" name="year" />年 <select
            name="month">
            <option value="1">一</option>
            <option value="2">二</option>
            <option value="3">三</option>
            <option value="4">四</option>
            <option value="4">五</option>
        </select>月 <select name="day">
            <option value="1">1</option>
            <option value="2">2</option>
            <option value="3">3</option>
            <option value="4">4</option>
            <option value="4">5</option>
        </select>日 <br /> <input type="submit" value="同意以下协议条款并提交" />
    </form>
    <br>
    <textarea>协议条款内容</textarea>
</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>
<style type="text/css">
.t {
    float: left;
    width: 120px;
    text-align: center;
    text-align-last: justify;
}
</style>
</head>
<body>
    <%
        request.setCharacterEncoding("utf-8");
        String yname = request.getParameter("yhm");
        String pw = request.getParameter("mm");
        String ysex = request.getParameter("xb");
        String em = request.getParameter("dzyj");
        String y = request.getParameter("year");
        String m = request.getParameter("month");
        String d = request.getParameter("day");
    %>
    <h1>您注册的信息如下:</h1>
    <span class="t">用户名:</span><%=yname%>
    <br />
    <span class="t">密码:</span><%=pw%>
    <br />
    <span class="t">性别:</span><%=ysex%>
    <br />
    <span class="t">电子邮件:</span><%=em%>
    <br />
    <span class="t">出生日期:</span><%=y%>年<%=m%>月<%=d%><br>
</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>
<style type="text/css">
.t {
    float: left;
    width: 60px;
    text-align: center;
    text-align-last: justify;
}
 
div {
    margin: 0px;
}
</style>
</head>
<body>
    <h1>求平均值:</h1>
    <form action="result.jsp" method="post">
 
        <div>
            <span class="t">姓名:</span><input type="text" name="yname" />
        </div>
        <br />
        <div>
            <span class="t">性别:</span> <input type="radio" name="xb" value=""
                checked="checked" />男 <input type="radio" name="xb" value="" /></div>
        <br />
        <div>
            <span class="t">班级:</span><select name="yc">
                <option value="1901">1901</option>
                <option value="1902">1902</option>
                <option value="1903">1903</option>
                <option value="1904">1904</option>
                <option value="1905">1905</option>
            </select>
        </div>
        <br />
        <div>
            <span class="t">语文:</span><input type="text" name="clanguage" />
        </div>
        <br>
        <div>
            <span class="t">数学:</span><input type="text" name="mathematics" />
        </div>
        <br>
        <div>
            <span class="t">英语:</span><input type="text" name="english" />
        </div>
        <br> <input type="submit" value="提交" /> <input type="reset"
            value="重置" />
    </form>
</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>
    <%
        request.setCharacterEncoding("utf-8");
        String yname = request.getParameter("yname");
 
        String ysex = request.getParameter("xb");
        String yc = request.getParameter("yc");
        String clanguage = request.getParameter("clanguage");
        String mathematics = request.getParameter("mathematics");
        String english = request.getParameter("english");
        int c = Integer.parseInt(clanguage);
        int m = Integer.parseInt(mathematics);
        int e = Integer.parseInt(english);
        double a = (double) (c + m + e) / 3;
    %>
    你好!<%=yc%>班的<%=yname%>同学!
    <br> 性别:<%=ysex%><br> 您的各科平均分是:<%=a%>
</body>
</html>

posted @ 2022-04-10 10:21  咸鱼大佬  阅读(8)  评论(0编辑  收藏  举报