WEBVTT

1
00:00:01.547 --> 00:00:04.192
<v Jonas>Hey there, it's now time for the final</v>

2
00:00:04.192 --> 00:00:06.108
coding challenge in this course,

3
00:00:06.108 --> 00:00:08.950
so that you can apply some of the new ES6 features

4
00:00:08.950 --> 00:00:12.508
that you just learned in this section.

5
00:00:12.508 --> 00:00:15.177
So in this challenge, what I want you to do

6
00:00:15.177 --> 00:00:17.025
is to imagine that you're working

7
00:00:17.025 --> 00:00:20.475
in a small town administration and that you're in charge

8
00:00:20.475 --> 00:00:24.306
of two town elements, parks and streets.

9
00:00:24.306 --> 00:00:26.286
And this is a very small town,

10
00:00:26.286 --> 00:00:30.128
so we currently only have three parks and four streets,

11
00:00:30.128 --> 00:00:34.493
but more parks or streets may be added in the future.

12
00:00:34.493 --> 00:00:36.859
Also, all of the parks and streets

13
00:00:36.859 --> 00:00:40.136
have to have a name and a build year.

14
00:00:40.136 --> 00:00:42.300
Now, at an end-of-the-year meeting,

15
00:00:42.300 --> 00:00:46.699
your boss wants a final report with the following data.

16
00:00:46.699 --> 00:00:49.127
First, he wants to know the tree density

17
00:00:49.127 --> 00:00:52.177
of each park in the town, and that's calculated

18
00:00:52.177 --> 00:00:56.344
by dividing the total number of trees by the park area.

19
00:00:57.410 --> 00:01:01.012
Second, the average age of each town's park

20
00:01:01.012 --> 00:01:03.587
and that one is calumniated by adding up

21
00:01:03.587 --> 00:01:08.302
all of the ages and dividing it by the number of parks.

22
00:01:08.302 --> 00:01:10.299
The third data that your boss wants to know

23
00:01:10.299 --> 00:01:14.282
is the name of the park that has more than 1,000 trees.

24
00:01:14.282 --> 00:01:16.838
So your boss knows that there is one park like this

25
00:01:16.838 --> 00:01:20.168
but he wants to know the name of that park.

26
00:01:20.168 --> 00:01:23.400
Okay, and as of the streets, we want to know

27
00:01:23.400 --> 00:01:26.374
the total and average length of the town's streets

28
00:01:26.374 --> 00:01:30.417
and also a size classification of each of the streets,

29
00:01:30.417 --> 00:01:32.940
and these should be classified into tiny,

30
00:01:32.940 --> 00:01:35.357
small, normal, big, and huge.

31
00:01:36.204 --> 00:01:37.816
And if the size is unknown,

32
00:01:37.816 --> 00:01:40.639
that the default is simply normal.

33
00:01:40.639 --> 00:01:44.396
And all this report data should be printed to the console

34
00:01:44.396 --> 00:01:45.675
so that it looks a little bit

35
00:01:45.675 --> 00:01:48.397
like this output that I have here.

36
00:01:48.397 --> 00:01:51.426
So we have the average age of our parks,

37
00:01:51.426 --> 00:01:54.534
and then in here, we also have the tree density

38
00:01:54.534 --> 00:01:56.520
of our three parks, and finally

39
00:01:56.520 --> 00:01:59.808
the park that has more than 1,000 trees.

40
00:01:59.808 --> 00:02:01.887
And for the streets, we have the total

41
00:02:01.887 --> 00:02:04.858
and average length and then the size classification

42
00:02:04.858 --> 00:02:08.520
for all of the four streets, and that's it.

43
00:02:08.520 --> 00:02:10.686
Now, in this challenge, I'm not gonna give you

44
00:02:10.686 --> 00:02:14.499
detailed steps on how to solve it like I did before,

45
00:02:14.499 --> 00:02:16.806
because I think that you're really ready

46
00:02:16.806 --> 00:02:19.399
to do it on your own at this point.

47
00:02:19.399 --> 00:02:22.058
And that being said, the goal of this challenge

48
00:02:22.058 --> 00:02:25.477
is of course that you use some of the ES6 concepts

49
00:02:25.477 --> 00:02:28.124
that we talked about just in this section.

50
00:02:28.124 --> 00:02:31.240
Things like classes, subclasses, template strings,

51
00:02:31.240 --> 00:02:34.015
default parameters, maps, arrow functions,

52
00:02:34.015 --> 00:02:36.848
and destructuring, for example,

53
00:02:36.848 --> 00:02:39.235
and of course, you don't need to build anything

54
00:02:39.235 --> 00:02:41.655
super fancy here because all I want

55
00:02:41.655 --> 00:02:43.596
with this challenge is for you to practice

56
00:02:43.596 --> 00:02:47.311
some of the new ES6 features here in this challenge.

57
00:02:47.311 --> 00:02:50.241
So, good luck with this one, and if you struggle

58
00:02:50.241 --> 00:02:53.193
with anything, then you can just watch the next video

59
00:02:53.193 --> 00:02:56.283
to see my personal solution to this challenge.

60
00:02:56.283 --> 00:02:59.866
But first, please try to do it on your own.

