-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathchallenge8.html
31 lines (31 loc) · 1.53 KB
/
challenge8.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Next Generation JS: Intro to ES6 - Coding Challenge VIII</title>
<!-- <style>h1 { text-decoration: underline; }</style> -->
</head>
<body>
<h1><u>Coding Challenge VIII</u></h1>
<p>
Suppose that you're working in a small town administration, and you're in charge of two town elements:
<ol>
<li>Parks</li>
<li>Streets</li>
</ol>
It's a very small town, so right now there are only 3 parks and 4 streets. All parks and streets have a name and a build year. <br>
At an end-of-year meeting, your boss wants a final report with the following:
<ol>
<li>Tree density of each park in the town (formula: number of trees/park area)</li>
<li>Average age of each town's park (formula: sum of all ages/number of parks)</li>
<li>The name of the park that has more than 1000 trees</li>
<li>Total and average length of the town's streets</li>
<li>Size classification of all streets: tiny/small/normal/big/huge. If the size is unknown, the default is normal</li>
</ol>
All the report data should be printed to the console. <br>
HINT: Use some of the ES6 features: classes, subclasses, template strings, default parameters, maps, arrow functions, destructuring, etc.
</p>
<script type="text/javascript" src="./scripts/challenge8.js"></script>
</body>
</html>