TO FIND THE TOTAL AND GRADE IN VBSCRIPT

<html>
 <body>
 <script type="text/vbscript">
 dim S1,S2,S3,S4,TOT,GRADE

s1=cint(inputbox("Enter mark1"))
s2=cint(inputbox("Enter mark2"))
s3=cint(inputbox("Enter mark3"))
s4=cint(inputbox("Enter mark4"))

tot=s1+s2+s3+s4

document.write("TOTAL  ="& TOT&"<br>")

 IF tot> 350 and tot <=400 then
            grade ="O"

 ELSEIF tot> 300 and tot <=350 then
            grade ="D"

 ELSEIF tot> 250 and tot <=300 then
           grade ="C"

 ELSEIF tot> 200 and tot <=250 then
          grade ="B"

 ELSEIF tot> 120 and tot <=200 then
         grade ="A"
ELSE
       GRADE="FAIL"

end if
document.write("GRADE IS = "&GRADE)
</script>
</body>
</html>

No comments:

Post a Comment