-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathchallenge_2.html
41 lines (39 loc) · 1.89 KB
/
challenge_2.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
31
32
33
34
35
36
37
38
39
40
41
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta http-equiv="X-UA-Compatible" content="ie=edge"/>
<title>JS Basics: Coding Challenge II</title>
</head>
<body>
<h1>Coding Challenge II</h1>
<p>
John and Mike both play basketball in different teams. In the latest 3 games, John's team scored 89, 120 and 103 points, while Mike's team scored 116, 94 and 123 points.
<ol>
<li>Calculate the average score for each team</li>
<li>
Decide which teams wins in average (highest average score), and print the winner to the console. Also include the average score in the output.
</li>
<li>
Create a boolean variable containing information about whether Mark has a higher BMI than John.
</li>
<li>
Print a string to the console containing the variable from step 3. (Something like "Is Mark's BMI higher than John's? true").
</li>
<li>
Then change the scores to show different winners. Don't forget to take into account there might be a draw (the same average score).
</li>
<li>
EXTRA: Mary also plays basketball, and her team scored 97, 134 and 105 points. Like before, log the average winner to the console. HINT: you will need the && operator to take the decision. If you can't solve this one, just watch the solution, it's no problem :)
</li>
<li>
Like before, change the scores to generate different winners, keeping in mind there might be draws.
</li>
</ol>
GOOD LUCK! 😀
</p>
<p><em>Check the developer console for the log</em></p>
<script src="./scripts/challenge_2.js" type="text/javascript"></script>
</body>
</html>