ASDV-WebDev/Semester 1/Assignments/JavaScript/MP10_CalebFontenot/public_html/Problem 6.html
2023-08-16 17:31:33 -05:00

43 lines
1.8 KiB
HTML

<!DOCTYPE html>
<!--
Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
Click nbfs://nbhost/SystemFileSystem/Templates/ClientSide/html.html to edit this template
-->
<html>
<head>
<title>TODO supply a title</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
table, th, td {
border: 1px solid;
text-align: center;
}
</style>
<script>
var name, attendance, homework, midterm, final, grade, iterate;
document.write("<table>");
// Write table header
document.write("<tr><th>Name</th><th>Attendance</th><th>Homework</th><th>Midterm</th><th>Final</th><th>Course Grade</th></tr>");
do {
name = prompt("Enter name:");
attendance = prompt("Enter attendance grade:");
homework = prompt("Enter homework grade:");
midterm = prompt("Enter midterm grade:");
final = prompt("Enter final grade:");
iterate = prompt("Done entering data? (Type true/false)");
grade = (midterm*0.3)+(final*0.4)+(homework*0.2)+(attendance*0.1);
document.write("<tr>");
document.write("<td>" + name + "</td>");
document.write("<td>" + attendance + "</td>");
document.write("<td>" + homework + "</td>");
document.write("<td>" + midterm + "</td>");
document.write("<td>" +final + "</td>");
document.write("<td>" + grade + "</td>");
document.write("</tr>");
} while (iterate === "false");
document.write("</table>");
</script>
</head>
</html>