Write a JavaScript Program to get scores until the user eters a score over 100. For each score entered, if the score is less than 60 and even, tell the user that fact and get this person’s name. When you exit, print the number of odd scores over 80, the highest score less than 70, and the average of all the scores in the 80s.
var eventotal = evencount = highodd = eightycount = 0;
testscore = prompt(“enter the first test score”,””);
testscore = parseInt(testscore);
while (testscore <= 100 )
{
if ((testscore< 60) && (testscore%2 == 0))
{
document.write(“this even score is less than 60” + “<p>”);
name = prompt(“what is this persons name?”,””);
}
if ((testscore % 2) == 1) && (testscore > 80) )
{
count = count + 1;
}
if (testscore < 70)
{
if (testscore>high)
{
high = testscore;
}
}
if ((testscore > 79) && (testscore < 90))
{
ec = ec + 1;
esum = esum + testscore;
}
testscore = prompt(“enter the next test score or 0 to exit”,””);
testscore = parseInt(testscore);
}
document.write(“the number of odd scores over 80 is ” + count + “<p>”);
document.write(“the highest score less than 70 is ” + high + “<p>”);
document.write(“the average score in the 80s is ” + esum/ec + “<p>”);
</script>
</body>
</html>