Chapter 2 SOP 6 12th I.T

 SOP 6.html

<!DOCTYPE html>
<html>
<head>
<title>Sop 6 Javascript program</title>
</head>
<body>
<h1>
Javascript program to compute average marks of students
</h1>
<form name="form1">
<p>Enter Marks of subjects of students
<br><br>
English Marks
<input type="text" name="txt_eng">
<br><br>
Physics Marks
<input type="text" name="txt_phy">
<br><br>
Chemistry Marks
<input type="text" name="txt_chem">
<br><br>
IT Marks
<input type="text" name="txt_it">
<br><br>
Maths Marks
<input type="text" name="txt_maths">
<br><br>
Biology Marks
<input type="text" name="txt_bio">
<br><br>
<input type="submit" value="Calculate Average & print grade"   onclick="calculate_grade()">
</form>
<script type="text/javascript">
function calculate_grade()
{
var m1,m2,m3,m4,m5,m6,avg;
m1=parseInt(form1.txt_eng.value);
m2=parseInt(form1.txt_phy.value);
m3=parseInt(form1.txt_chem.value);
m4=parseInt(form1.txt_it.value);
m5=parseInt(form1.txt_maths.value);
m6=parseInt(form1.txt_bio.value);
avg=(m1+m2+m3+m4+m5+m6)/6;  //computes the average of six subjects of students
alert("Average marks of students for six subjects is:"+ avg);

if(avg>=91 && avg<=100)
{
grade = 'A';
}

else if(avg>=81 && avg<=90)
{
grade = 'B';
}

else if(avg>=71 && avg<=80)
{
grade = 'C';
}

else if(avg>=61 && avg<=70)
{
grade = 'D';
}

else if (avg>=35 && avg<=60) 
{
grade = 'F';
alert ("Grade of the student is: "+ grade);
}
</script>
</body>
</html>

output

Chapter 2 SOP 6 Solution 12th I.T

Tags :-
12th I.T SOP solution,
12th I.T SOP,
12th I.T chapter 2 SOP solution,
12th I.T chapter 2 SOP 6 solution,
12th I.T SOP 6


Post a Comment

0 Comments