-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgrades.html
More file actions
40 lines (22 loc) · 766 Bytes
/
grades.html
File metadata and controls
40 lines (22 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<h1 id='message'></h1>
<script type="text/javascript">
var english = Number(prompt("Your grade in english"));
var math = Number(prompt("Your grade in math"));
var physics = Number(prompt("Your grade in physics"));
function sum(english,math,physics) {
return english + math + physics;
}
function average(english,math,physics) {
return (english + math + physics)/3;
}
document.write("The sum of your grade is " + sum(english, math, physics));
document.write("The average of your grade is " + Math.round(average(english, math, physics)));
</script>
</body>
</html>