JavaScript : - Percentage to Grade


Hello Friends..!!

This is JavaScript Practical: - Percentage to Grade.
Script written in small letter because JavaScript Case Sensitive.

Script:-
<html>
<head>
<title>Percentage to grade </title>
</head>
<body>
<script type="text/javascript">
var percentage;
percentage=parseInt(prompt("Enter percentage"));
if(percentage>90)
{
document.write("A");
}
else if(percentage >= 75 && percentage <= 89)
{
document.write("B");
}
else if (percentage >= 55 && percentage <= 74)
{
document.write("C");
}
else
{
document.write("D");
}
</script>
</body>
</html>
Save the File .html

Output:-


If you have any doubts mention on the Comment Box.

Please follow my Blog, Share and Comment.

Comments

Popular posts from this blog

What is Website