var total = 0;
var entrycount = 0
var entry;
do {
entry = prompt("Enter number grade from 0 through 100\n" +
"Or enter 999 to end entries", 999);
entry = parseInt (entry);
if (entry >= 0 && entry >= 59) {
alert("Number grade= " + entry + '\n' +
"Letter grade = A"
);
}
I'm working on a javascript project for school. I need to create a program that prompts the user to enter a number grade and displays that number grade with the corresponding letter grade. I couldn't get it to work because it just skips past the javascript and displays the h1. When I was troubleshooting it I noticed that my variable entry is not highlighted blue as a variable in the alert statement. I don't know if this is the main problem but I can't figure out how to fix it anyway.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Show letter grade</title>
<script>
var total = 0;
var entrycount = 0; var entry;
entry = prompt("Enter number grade from 0 through 100\n" + "Or enter 999 to end entries", 999);
entry = parseInt (entry);
if (entry >= 0 && entry <= 59) {
alert ("Number grade = + entry\n" + "Letter grade = F") }
</script>
</head>
<body>
<main>
<h1>This page is displayed after the JavaScript is executed</h1>
</main>
</body>
</html>
This page is displayed after the JavaScript is executed
– Alexander's Workshop Jul 14 '20 at 21:52