-
Notifications
You must be signed in to change notification settings - Fork 2
/
challenge_4.html
30 lines (29 loc) · 1.22 KB
/
challenge_4.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>JS Basics: Coding Challenge IV</title>
</head>
<body>
<h1>Coding Challenge IV</h1>
<p>
Let's remember the first coding challenge where Mark and John compared their BMIs.<br/>Let's now implement the same functionality with objects and methods.
<ol>
<li>
For each of them, create an object with properties for their full name, mass, and height.
</li>
<li>
Then, add a method to each object to calculate the BMI. Save the BMI to the object and also return it from the method.
</li>
<li>
In the end, log to the console who has the highest BMI, together with the full name and the respective BMI. Don't forget they might have the same BMI.
</li>
</ol>
Remember: BMI = mass / height^2 = mass / (height * height). (mass in kg and height in meter). <br/>
GOOD LUCK! 😀
</p>
<p><em>Check the developer console for the log</em></p>
<script src="./scripts/challenge_4.js" type="text/javascript"></script>
</body>
</html>