0% found this document useful (0 votes)
3 views

It Java Marks

The document contains code to calculate a student's total marks, percentage, and grade based on inputting individual subject marks. The JavaScript code takes the subject marks as input, calculates the total and percentage, and determines the grade based on the percentage range.

Uploaded by

dhairysheel2394
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

It Java Marks

The document contains code to calculate a student's total marks, percentage, and grade based on inputting individual subject marks. The JavaScript code takes the subject marks as input, calculates the total and percentage, and determines the grade based on the percentage range.

Uploaded by

dhairysheel2394
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

<html>

<head>

<title>Enter Marks</title>

<script type="text/javascript">

function submit_marks()

var sub1 = parseInt(document.getElementById('s1').value);

var sub2 = parseInt(document.getElementById('s2').value);

var sub3 = parseInt(document.getElementById('s3').value);

var sub4 = parseInt(document.getElementById('s4').value);

var sub5 = parseInt(document.getElementById('s5').value);

var sub6 = parseInt(document.getElementById('s6').value);

var total = sub1+sub2+sub3+sub4+sub5+sub6;

var per = total/6;

var grade;

if (per>=35 && per<=60)

grade = 'F';

else if(per>=61 && per<=70)

grade = 'D';

else if(per>=71 && per<=80)

grade = 'C';

else if(per>=81 && per<=90)

grade = 'B';
}

else if(per>=91 && per<=100)

grade = 'A';

else

grade = "Invalid or Failed";

document.write("Your Total Marks : "+total);

document.write("<br>Your Percentage : "+per);

document.write("<br>Your Grade : "+grade);

</script>

</head>

<body>

<h1>Enter Students Marks</h1>

<input type="text" id="s1" placeholder="Enter English Marks"><br>

<input type="text" id="s2" placeholder="Enter IT Marks"><br>

<input type="text" id="s3" placeholder="Enter OCM Marks"><br>

<input type="text" id="s4" placeholder="Enter Economics Marks"><br>

<input type="text" id="s5" placeholder="Enter Maths Marks"><br>

<input type="text" id="s6" placeholder="Enter Account Marks"><br>

<input type="submit" onclick="submit_marks()">


</body>

</html>

You might also like