Code
var studentGrade = window.prompt('Enter your grade:','');
while (studentGrade > 100)
{
var studentGrade = window.prompt('Enter a valid grade:','');
if (studentGrade <= 100)
{
break;
}
}
if(studentGrade <= 39)
{
document.write("Fail");
}
else if (studentGrade <= 59)
{
document.write("Pass");
}
else if(studentGrade <= 69)
{
document.write("Merit");
}
else if(studentGrade <= 100)
{
document.write("Distinction");
}