Filename: Student18.html
<!-- 18. Program to read student information -->
<html>
<head>
<title>Student Information</title>
</head>
<body>
<h3>Enter Student Details:<h3>
<form action="Student18.jsp" method="POST" >
<table >
<tr><td>Name:</td><td><input type="text" name="sname" autofocus></td></tr>
<tr><td>Register Number:</td><td><input type="text" name="regno"></td></tr>
<tr><td>Sub1:</td><td><input type="text" name="sub1"></td></tr>
<tr><td>Sub2:</td><td><input type="text" name="sub2"></td></tr>
<tr><td>Sub3:</td><td><input type="text" name="sub3"></td></tr>
<tr><td>Sub4:</td><td><input type="text" name="sub4"></td></tr>
<tr><td>Sub5:</td><td><input type="text" name="sub5"></td></tr>
<tr><td><input type="submit" value="Submit"></td><td><input type="reset" value="Reset"></td></tr>
</table>
</body>
</html>
Filename: Student18.jsp
<!-- 18. JSP Program to evaluate the result of a student. -->
<html>
<head>
<%@ page import="java.io.*,java.util.*" %>
</head>
<body>
<%
String sname=request.getParameter("sname");
String regno=request.getParameter("regno");
int m1=Integer.parseInt(request.getParameter("sub1"));
int m2=Integer.parseInt(request.getParameter("sub2"));
int m3=Integer.parseInt(request.getParameter("sub3"));
int m4=Integer.parseInt(request.getParameter("sub4"));
int m5=Integer.parseInt(request.getParameter("sub5"));
int total_marks;
float percent;
String grade="";
total_marks=m1+m2+m3+m4+m5;
percent = (float)(total_marks*100) / 500;
if(m1<40 || m2<40 || m3<40 || m4<40 || m5<40)
grade= "FAIL";
else
{
if(percent >=70)
grade = "DISTINCTION";
else if(percent >= 60 && percent < 70)
grade = "FIRST CLASS";
else if(percent >= 50 && percent < 60)
grade = "SECOND CLASS";
else if(percent >= 40 && percent < 50)
grade = "PASS";
}
%>
<h3> Kuvempu University</h3>
<h3> MARKS SHEET</h3>
<b>Name of the Student: <%=sname%>
<br>
Register Number : <%=regno%></b>
<br>
================================================================================
<br>
SUBJECTS MAX.MARKS MIN.MARKS MARKS OBTAINED
<br>
================================================================================<br>
1. K/U/H/S
100 40 <%=m1%>
<br>
2. ENGLISH
100
40
<%=m2%>
<br>
3. JAVA PROGRAMMING
100
40
 <%=m3%><br>
4. OPERATIONS RESEARCH
100
40
 <%=m4%><br>
5. COMPUTER GRAPHICS
100
40
<%=m5%><br>
================================================================================<br>
<b>TOTAL MARKS
:
500
200
<%=total_marks%></b><br>
================================================================================<br>
<b>PERCENTAGE MARKS : <%=percent%>%</b><br>
<b>GRADE
: <%=grade%></b><br>
================================================================================<br>
</body>
</html>
<!-- 18. Program to read student information -->
<html>
<head>
<title>Student Information</title>
</head>
<body>
<h3>Enter Student Details:<h3>
<form action="Student18.jsp" method="POST" >
<table >
<tr><td>Name:</td><td><input type="text" name="sname" autofocus></td></tr>
<tr><td>Register Number:</td><td><input type="text" name="regno"></td></tr>
<tr><td>Sub1:</td><td><input type="text" name="sub1"></td></tr>
<tr><td>Sub2:</td><td><input type="text" name="sub2"></td></tr>
<tr><td>Sub3:</td><td><input type="text" name="sub3"></td></tr>
<tr><td>Sub4:</td><td><input type="text" name="sub4"></td></tr>
<tr><td>Sub5:</td><td><input type="text" name="sub5"></td></tr>
<tr><td><input type="submit" value="Submit"></td><td><input type="reset" value="Reset"></td></tr>
</table>
</body>
</html>
Filename: Student18.jsp
<!-- 18. JSP Program to evaluate the result of a student. -->
<html>
<head>
<%@ page import="java.io.*,java.util.*" %>
</head>
<body>
<%
String sname=request.getParameter("sname");
String regno=request.getParameter("regno");
int m1=Integer.parseInt(request.getParameter("sub1"));
int m2=Integer.parseInt(request.getParameter("sub2"));
int m3=Integer.parseInt(request.getParameter("sub3"));
int m4=Integer.parseInt(request.getParameter("sub4"));
int m5=Integer.parseInt(request.getParameter("sub5"));
int total_marks;
float percent;
String grade="";
total_marks=m1+m2+m3+m4+m5;
percent = (float)(total_marks*100) / 500;
if(m1<40 || m2<40 || m3<40 || m4<40 || m5<40)
grade= "FAIL";
else
{
if(percent >=70)
grade = "DISTINCTION";
else if(percent >= 60 && percent < 70)
grade = "FIRST CLASS";
else if(percent >= 50 && percent < 60)
grade = "SECOND CLASS";
else if(percent >= 40 && percent < 50)
grade = "PASS";
}
%>
<h3> Kuvempu University</h3>
<h3> MARKS SHEET</h3>
<b>Name of the Student: <%=sname%>
<br>
Register Number : <%=regno%></b>
<br>
================================================================================
<br>
SUBJECTS MAX.MARKS MIN.MARKS MARKS OBTAINED
<br>
================================================================================<br>
1. K/U/H/S
100 40 <%=m1%>
<br>
2. ENGLISH
100
40
<%=m2%>
<br>
3. JAVA PROGRAMMING
100
40
 <%=m3%><br>
4. OPERATIONS RESEARCH
100
40
 <%=m4%><br>
5. COMPUTER GRAPHICS
100
40
<%=m5%><br>
================================================================================<br>
<b>TOTAL MARKS
:
500
200
<%=total_marks%></b><br>
================================================================================<br>
<b>PERCENTAGE MARKS : <%=percent%>%</b><br>
<b>GRADE
: <%=grade%></b><br>
================================================================================<br>
</body>
</html>
No comments :
Post a Comment