第四次作业

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%--<%
    request.setCharacterEncoding("UTF-8");
    response.setCharacterEncoding("UTF-8");
    %> --%>
<html>
<head>

</head>

<body>
    <div>
        <div style="float: left">
            <img alt="" src="baidu.png" width="150px" height="40px">
        </div>
        <div style="float: left" style="position:relative;left:30px;top:20px">
            用户注册 &nbsp;&nbsp;&nbsp;&nbsp; <a href="#">帮助</a>
        </div>
    </div>
    <br>
    <form action="info.jsp" method="post">
        <br>
        <br> 用户名: &nbsp;<input type="text" name="uname" />只能输入字母或数字,4-16个字符<br>
        密码 &nbsp;:<input type="password" name="upsd" />密码长度6-12位<br>
        确认密码: &nbsp;<input type="password" name="yes" /><br> 
        性别:&nbsp;<input type="radio" name="sex" value=""><input type="radio" name="sex" value="">女<br>
             电子邮箱地址: &nbsp;
             <input type="email" name="email" />输入正确的email地址<br> 出生日期: <input
            type="date" name="birth" /><br>

        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <input type="submit" name="submit" value="同意以下协议条款并提交" /><br>
        <textarea rows="5" cols="40">
        今天天气很好今天天气很好今天天气很好今天天气很好今天天气很好今天天气很好今天天气很好今天天气很好今天天气很好今天天气很好今天天气很好今天天气很好今天天气很好
        </textarea>

    </form>

</body>
</html>

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%--<%
    request.setCharacterEncoding("UTF-8");
    response.setCharacterEncoding("UTF-8");
    %> --%>
<html>
<head>

</head>

<body>
    您注册的信息如下:
    <br>

    <%
        request.setCharacterEncoding("utf-8");
        String uname = request.getParameter("uname");
        String upsd = request.getParameter("upsd");
        String sex = request.getParameter("sex");
        String email = request.getParameter("email");
        String birth = request.getParameter("birth");
        String birth1 = request.getParameter("birth1");
        String birth2 = request.getParameter("birth2");
    %>
    您注册的用户名是:<%=uname%><br> 密码:<%=upsd%><br> 性别:<%=sex%><br>
    电子邮件:<%=email%><br> 出生日期:<%=birth%><br>

</body>
</html>

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

<html>


<body>
    <form action="regist.jsp" method="post">
        求平均值: <br> 
        姓名:<input type="text" name="uname" /><br> <br>
        性别:<input type="radio" name="sex" value="" /><input type="radio"name="sex" value="" /><br> <br> 
        班级:<select name="cla">
            <option value="计算机1901">计算机1901</option>
            <option value="计算机1902">计算机1902</option>
        </select><br> <br> 
        数学:<input type="text" name="math" /> <br> 
        语文:<input type="text" name="chin" /> <br> 
        英语:<input type="text" name="eng" /> <br> 
        <input type="submit" value="提交" /> 
        <input type="reset" value="重置" />
    </form>
</body>
</html>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>

<html>

<body>

    <%
        request.setCharacterEncoding("utf-8");
           String uname=request.getParameter("uname");
           String sex=request.getParameter("sex");
           String cla=request.getParameter("cla");
           String math=request.getParameter("math");
           String chin=request.getParameter("chin");
           String eng=request.getParameter("eng");
           double  a=Double.parseDouble(math);
           double  b=Double.parseDouble(chin);
           double  c=Double.parseDouble(eng);
           double equi=(a+b+c)/3;
           out.print("你好!"+cla+""+uname+"同学!"+"</br>"+"性别:"+sex+"</br>"+
           "您的各科平均分数是:"+equi);
    %>
</body>
</html>

 

posted @ 2022-04-10 19:13  计算机1902张铭麟  阅读(6)  评论(0编辑  收藏  举报