第六周作业

1.

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


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
        
  </head>
  
  <body>
  <form action="MyJsp.jsp" method = "post">
  用  户  名: <input type="text" name="uname">只能输入字母或数字,4-16个字符<br>&nbsp&nbsp&nbsp&nbsp&nbsp     码:    <input type="password" name="upwd"><br>
  确认密码: <input type="password" name="upwdd"><br>&nbsp&nbsp&nbsp&nbsp&nbsp  别:    <input type="radio" name="sex" value="男"><input type="radio" name="sex" value="女">女<br>
  电子邮件: <input type="text" name="email">输入正确的Email地址<br>
  出生日期: <select name=year>
  <option value="1999">1999
  <option value="2000">2000
  <option value="2001">2001
  </select>年
  <select name=month>
  <option value="1">1
  <option value="2">2
  <option value="3">3
  <option value="4">4
  <option value="5">5
  <option value="6">6
  <option value="7">7
  <option value="8">8
  <option value="9">9
  <option value="10">10
  <option value="11">11
  <option value="12">12
  </select>月
  <select name=day>
  <option value="1">1
  <option value="2">2
  <option value="3">3
  <option value="4">4
  <option value="5">5
  <option value="6">6
  <option value="7">7
  <option value="8">8
  <option value="9">9
  <option value="10">10
  <option value="11">11
  <option value="12">12
  </select>日
   <br>
   <input type="submit" value="同意以下协议条款并提交"><br>
   <textarea rows="10" cols="40">协议条款</textarea>
   </form>
  </body>
</html>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
        
  </head>
  
  <body>
  <%
  request.setCharacterEncoding("utf-8");
  String uname=request.getParameter("uname");
  String password=request.getParameter("upwd");
  
  String sex=request.getParameter("sex");
  String email=request.getParameter("email");
  String year=request.getParameter("year");
  String month=request.getParameter("month");
  String day=request.getParameter("day");
   %>
 用户名:<%=uname %><br>
 密码:<%=password %><br>
 性别:<%=sex %><br>
 邮箱:<%=email %><br>
 出生日期:<%=year %>年<%=month %>月<%=day %>日<br>
  </body>
</html>

2.

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
 
 <%
    request.setCharacterEncoding("UTF-8");
    response.setCharacterEncoding("UTF-8");
    %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 
  <body>
   <form action="MyJsp.jsp" method="post" >
        求平均值:</br>
        姓名:<input type="text" name="uname" /><br>
        性别:<input type="radio" name="sex" value ="男"/> 男
         <input type="radio" name="sex" value ="女"/> 女<br>
        班级:<select name = "bj">
        <option value="计算机1901">计算机1901</option>
        <option value="计算机1902">计算机1902</option>
        <option value="计算机1903">计算机1903</option>
        </select><br>
        数学:<input  type="number"  name="math" /></br>
        语文:<input  type="number"  name="chinese" /></br>
        英语:<input  type="number"  name="english" /></br>
        <input type="submit" value="提交"/>
        <input type="reset" value="重置"/>
        </form>
     
  </body>
</html>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
 <%
    request.setCharacterEncoding("UTF-8");
    response.setCharacterEncoding("UTF-8");
    %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
   
  <body>
    <%
            String uname=request.getParameter("uname");
            String sex=request.getParameter("sex");
            String bj=request.getParameter("bj");
            String bir=request.getParameter("bir");
            String math=request.getParameter("math");
            String chinese=request.getParameter("chinese");
            String english=request.getParameter("english");
            double  a=Double.parseDouble(math);
            double  b=Double.parseDouble(chinese);
            double  c=Double.parseDouble(english);
            double arg=(a+b+c)/3;
            out.print("你好!"+bj+"的"+uname+"同学!"+"</br>"+"性别:"+sex+"</br>"+
            "您的各科平均分数是:"+arg);
         %>
  </body>
</html>
  

 

posted @ 2022-04-10 13:12  无言De钉钉  阅读(12)  评论(0编辑  收藏  举报