Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JSP-Servlet Write a JSP program to display the grade of a student by accepting the marks of five subjects.
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Reetu Gupta
Write a JSP program to display the grade of a student by accepting the marks of five subjects.
2 Answer(s)      a year and 4 months ago
Posted in : JSP-Servlet


Write a JSP program to display the grade of a student by accepting the marks of five subjects.


Advertisement
View Answers

May 22, 2013 at 7:35 PM


hi friend,

Try the following code, may this will be helpful for you

    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!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=ISO-8859-1">
<title>Student Marks</title>
</head>
<body>
<h2>Student Grading System</h2>
<form action="" method="post">
<table>
<tr>
<td></td>
<td>
Select Course <select name="course">
<option value="select">select</option>
<option value="MCA">MCA</option>
<option value="BCA">BCA</option>
</select>
</td>
</tr>
</table>
<table>
<tr>
<th>Subject</th>
<th>Obtained Marks</th>
<th>Total Marks</th>
</tr>
<tr>
<td align="center">C</td>
<td align="center"><input type="text" size="5" name="c"/></td>
<td align="center">100</td>
</tr>
<tr>
<td align="center">Java</td>
<td align="center"><input type="text" size="5" name="java"/></td>
<td align="center">100</td>
</tr>
<tr>
<td align="center">.Net</td>
<td align="center"><input type="text" size="5" name="net"/></td>
<td align="center">100</td>
</tr>
<tr>
<td align="center">VB</td>
<td align="center"><input type="text" size="5" name="vb"/></td>
<td align="center">100</td>
</tr>
<tr>
<td align="center">DBMS</td>
<td align="center"><input type="text" size="5" name="dbms"/></td>
<td align="center">100</td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
<tr><td></td><td align="center"><input type="submit" value="submit"/></td></tr>
</table>
</form>

Continue.....



May 22, 2013 at 7:35 PM


<%
String c = request.getParameter("c");
String j = request.getParameter("java");
String n = request.getParameter("net");
String v = request.getParameter("vb");
String d = request.getParameter("dbms");
if(!(c == null || c.isEmpty()))
{
    int cmarks = Integer.parseInt(c);
    int jmarks = Integer.parseInt(j);
    int nmarks = Integer.parseInt(n);
    int vmarks = Integer.parseInt(v);
    int dmarks = Integer.parseInt(d);

    int total = cmarks+jmarks+nmarks+vmarks+dmarks;
    int avg = (total)/5;
    int percent = avg;
    String grade ="";

    if(percent < 40){
        grade = "E";
        //request.setAttribute("grade", grade);
    }
    else if(percent >= 40 && percent <=44){
        grade = "D";
    }
    else if(percent >=45 && percent <=49){
        grade = "D+";
    }
    else if(percent >=50 && percent <=54){
        grade = "C-";
    }
    else if(percent >=55 && percent<=59){
        grade = "C";
    }
    else if(percent >=60 && percent <=64){
        grade = "C+";
    }
    else if(percent >=65 && percent<=69){
        grade = "B-";
    }
    else if(percent >=70 && percent <=74){
        grade = "B";
    }
    else if(percent >=75 && percent <=79){
        grade = "B+";
    }
    else if(percent >=80 && percent <=84){
        grade = "A";
    }
    else if (percent >=85 && percent <=100){
        grade = "A+";
    }
    request.setAttribute("Grade", grade);
    %>    
    <table>
    <tr>
    <td><b>Course</b></td><td></td>
    <td align="center"><%=request.getParameter("course") %>
    </tr>
    <tr>
    <td><b>Aggregate Marks</b></td><td></td>
    <td align="center"><%=total %></td>
    </tr>
    <tr>
    <td><b>Grade</b></td><td></td>
    <td align="center"><%=grade %></td>    
    </tr>
    </table>
    <%    
}
%>

</body>
</html>

Thank.



Related Tutorials/Questions & Answers:
Write a JSP program to display the grade of a student by accepting the marks of five subjects.
Write a JSP program to display the grade of a student by accepting the marks of five subjects.  Write a JSP program to display the grade of a student by accepting the marks of five subjects
Write a program to display grade message according to the marks
Write a program to display grade message according to the marks  pls give d answer how to Write a program to display grade message according to the marks     Write a program to display grade message according
Advertisements
write a java program to print marklist of n students. input Register number, name and marks of three subjects.
write a java program to print marklist of "n " students. input Register number, name and marks of three subjects.  write a java program to print marklist of "n " students. input Register number, name and marks of three subjects
Student Marks
, and having trouble with it please help me. Write a program to compute the computer... in an array. Addresses of Students and store them in array. Previous Grade for student.... Then work out and display The average Final Grade for the √Ę‚?¨ň?Computer
Student Marks
Student Marks  Create a simple application which can calculate 5 marks entered by user and find the grade. Create a simple application which can calculate 5 marks entered by user and find the grade. You must display the grade
Write a program that takes the marks of user as input
Write a program that takes the marks of user as input  Write a program that takes the marks of user as input. If marks are greater then 60 the program should display "Great, you have passed the course", else the program should
Write a program using JSP that enables any student to change his/her address.
Write a program using JSP that enables any student to change his/her address.  Write a program using JSP that enables any student to change his/her address
Write a program to get student details and store in a database
Write a program to get student details and store in a database  Write a program to get student details and store in a database
WRITE A PROGRAM IN JAVA
WRITE A PROGRAM IN JAVA  Write program which accepts five students id,name,age,department,courses, taken and its grade. a. calculate its GPA . display all student information in ascending order
to write a program to display the employee details..
to write a program to display the employee details..  To dipslay... running this program the new window has to be opened asking us to enter all...   not this one actually i wnat a very small program that displays all
student marks sheet genaration in struts frame work
student marks sheet genaration in struts frame work  Hi every body iam using struts frame work back end as oracle 10g xe i wanna urgent code for student marks genaration code please help me thanks in advance
Java Program for Calculating Marks
Java Program for Calculating Marks  Hi Everyone, I have a assignment that requires me to a write simple java program that will calculate marks for 10 students. I must use an array to ask user to key in the marks for the 10
Java Program for Calculating Marks
Java Program for Calculating Marks  Hi Everyone, I have a assignment that requires me to a write simple java program that will calculate marks for 10 students. I must use an array to ask user to key in the marks for the 10
Java Program for Calculating Marks
Java Program for Calculating Marks  Hi Everyone, I have a assignment that requires me to a write simple java program that will calculate marks for 10 students. I must use an array to ask user to key in the marks for the 10
Java Program for Calculating Marks
Java Program for Calculating Marks  Hi Everyone, I have a assignment that requires me to a write simple java program that will calculate marks for 10 students. I must use an array to ask user to key in the marks for the 10
program to print total marks
program to print total marks  program to input total marks out of 600 marks as an argument and print the stream allotted using the following criteria 401 & above - PCM 301-400 - ZBC 201-300- Commerce 101-200 - Arts
final grade
a student?s final grade from 50-100. Evaluate the Final grade and display the Point...? or ?Failed   C. Write a JavaScript program that would input a student...? or ?Failed   C. Write a JavaScript program that would input a student?s
program to input marks
program to input marks  program to input marks ,name in computer application 7 annual fees to be paid .Decide the scholarship amount as per the given criteria Marks Scholarship(%)on Annual Fees =90
How to solve this java code by adding the student marks not in the list of the table. For example -10 and 156 in GUI?
How to solve this java code by adding the student marks not in the list... of student getting A+ and A grade: " + (count1 + count2)); JOptionPane.showMessageDialog(null,"Number of student getting B+ and B grade
PLEASE Help me write a Java program which will store, manipulate, and print student registration information.
PLEASE Help me write a Java program which will store, manipulate, and print student registration information.  HERES TEH QUESTION - I AM MISSING SOME..., ADDRESS AND ADMISSIONS CLASS PLEASE HELP!!! Write a Java program which
Student average
should display the average grade of the student and would display the message... to maintain this status is to maintain an average not below 1.8. write a java program that reads student's number of subject taken, the final grade of each subject
the grade of students
the grade of students  Write a Java program that prompt user to input...?Ęs programming mark. Determine how many student get A+ and A for their grade and how many students get D and E based on the following table: Marks
How to write Java Program
How to write Java Program  how to write a program to find average of 5 student marks
Write a java program to display the season given the month using switch case
Write a java program to display the season given the month using switch case  Write a java program to display the season given the month using switch case
Engineering Subjects for Placement
Engineering Subjects for Placement   Which subjects should be perfect for campus placement purpose for Computer Engineering student
write a program
write a program  write a program add 2 no.s without use arithmetic,unary operaters in java
Write a question to display the follwing
Write a question to display the follwing  Write a Java program to display a pattern?   String str = ""; int count = 4; for( int i=9,j...++; } System.out.print(str);   class Display { public void
Java GUI to build a Student Registration Program
Java GUI to build a Student Registration Program   Write a program... should graphically display a sorted list of registered courses for a student... by creating a driver program to load the student data base and the course data
adding a method to calculate a students grade
a method to display the grade based on the mark of the student i cant seem... someone help please the program code is as follows: class Student { private... grade; public Student(int theStudentID, String theName) { studentID
how to write this program
or numerical grade. You will be submitting TWO versions of this program. Write one...how to write this program  Write a program in java which calculates...?Ęs GPA. This program should take a student√Ę‚?¨‚?Ęs First Name, Last Name a GPA
marks - Java Beginners
as fallow:- NAME MARKS wap a program... applications. calculate the display:- *average marks in the subject of computer... Student { String name; double marks; public Student(String n, double s
 

 

 

DMCA.com