Skip to content

Instantly share code, notes, and snippets.

@dnlsyfq
Created August 23, 2021 18:54
Show Gist options
  • Save dnlsyfq/c96b6791db62dd9e082560503a20133b to your computer and use it in GitHub Desktop.
Save dnlsyfq/c96b6791db62dd9e082560503a20133b to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/kivivab
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<p id="ass" style="color:black;"></p>
<script src="app.js"></script>
<script id="jsbin-javascript">
let assignment = 1;
let html = ``;
let points = 0;
while(assignment < 4){
let point = +prompt(`Enter assignment ${assignment} points ?`);
points += point;
html += `Points earned for assignemnt ${assignment}: ${point} <br>`;
assignment += 1;
}
html += `<hr>Total Points: ${points} <br>`;
html += `Average point value: ${points/3}`;
document.getElementById("ass").innerHTML = `${html}`;
</script>
<script id="jsbin-source-javascript" type="text/javascript"> let assignment = 1;
let html = ``;
let points = 0;
while(assignment < 4){
let point = +prompt(`Enter assignment ${assignment} points ?`);
points += point;
html += `Points earned for assignemnt ${assignment}: ${point} <br>`;
assignment += 1;
}
html += `<hr>Total Points: ${points} <br>`;
html += `Average point value: ${points/3}`;
document.getElementById("ass").innerHTML = `${html}`;</script></body>
</html>
let assignment = 1;
let html = ``;
let points = 0;
while(assignment < 4){
let point = +prompt(`Enter assignment ${assignment} points ?`);
points += point;
html += `Points earned for assignemnt ${assignment}: ${point} <br>`;
assignment += 1;
}
html += `<hr>Total Points: ${points} <br>`;
html += `Average point value: ${points/3}`;
document.getElementById("ass").innerHTML = `${html}`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment