WEBVTT

00:01.780 --> 00:07.480
I'm sure that you could do this coding task at least tried hard to find the solution, but if not,

00:07.480 --> 00:08.530
let's do it together.

00:09.220 --> 00:15.550
So the first step was to create variables, to present course of exams for John and Nick and set the

00:15.550 --> 00:16.800
values as it.

00:16.810 --> 00:17.860
And 45.

00:18.840 --> 00:21.990
So let's create variables score of John.

00:23.160 --> 00:29.670
Equals to it, and then score of Neek equals to four to five.

00:31.460 --> 00:37.760
The next step is to create the variable, to set the lower limit for passing the exam and assigned to

00:37.760 --> 00:39.510
it the value as 51.

00:40.400 --> 00:41.960
Let's do it right.

00:42.170 --> 00:44.900
Variable plus equals to 51.

00:46.580 --> 00:47.060
All right.

00:47.540 --> 00:49.700
Let's move on to the main part of the task.

00:50.080 --> 00:56.090
Third step tells us the right condition in your statement, which will check if both students have passed

00:56.090 --> 00:58.700
an exam and log the result in council.

00:59.450 --> 01:01.190
So create if statement.

01:02.640 --> 01:08.400
The condition should be the following, if we want to check, if both students have passed an exam that

01:08.400 --> 01:10.860
we had to write a score of John.

01:11.940 --> 01:21.000
Is greater than or equal to pass after that, we have to use logical and operator in order to check

01:21.000 --> 01:22.800
both conditions simultaneously.

01:23.280 --> 01:23.480
So.

01:23.490 --> 01:29.700
Right, and then score of Nick is greater than or equal to pass.

01:32.530 --> 01:41.050
And then in order to display the results in Castle, right, Castle, that log both students passed.

01:44.320 --> 01:51.040
Reload the page and see that we have nothing, as you remember, logical and operator needs to both

01:51.040 --> 01:52.170
conditions to be true.

01:52.630 --> 01:56.130
And because of that, this core of Nick is less than past.

01:56.680 --> 01:57.810
The condition is false.

01:59.290 --> 02:05.800
All right, let's move on to the next step, which tells us to use elusive statement in order to check

02:05.800 --> 02:09.890
if one of the students has passed an exam and locked the resulting castle.

02:10.810 --> 02:12.130
Let's do it right.

02:12.130 --> 02:24.250
Alsup statement with the following condition score of John is greater than or equal to us here.

02:24.250 --> 02:31.240
We need to use logical or operator because it allows us to check if one of the conditions or both of

02:31.240 --> 02:32.110
them are true.

02:33.010 --> 02:38.680
So right, Scott of Knigge is greater than or equal to pass.

02:41.310 --> 02:43.320
And then running council.

02:46.600 --> 02:54.820
One of the students passed reload the page and you see that one of the students passed.

02:55.360 --> 02:57.400
Let's explain what has happened to you.

02:57.940 --> 03:00.640
Because of that, we got the results of LCP statement.

03:01.570 --> 03:09.340
It's proof that only one condition is true in Alsi because if both were true, we would get the results

03:09.340 --> 03:11.260
of its statement and not else.

03:11.290 --> 03:18.580
If, in other words, if the condition of its statement was true, the engine would terminate executing

03:18.580 --> 03:21.790
all remaining Cote's makes sense.

03:23.620 --> 03:28.030
If not, you can post the video and try to figure out on your own.

03:29.290 --> 03:35.200
All right, let's move on to the next step, which asks to use all statements in order to display in

03:35.200 --> 03:37.990
counsel that both students have failed.

03:38.500 --> 03:45.580
It's very simple to do just write your statement and then run and counsel.

03:47.230 --> 03:50.260
Both of the students failed.

03:54.260 --> 04:01.220
All right, the next step is a bit interesting, it tells us the following in case of passing the exam

04:01.220 --> 04:07.950
by one of the students, find out which one was that and this displaying council as an additional information,

04:08.300 --> 04:10.190
the student name and his points.

04:11.750 --> 04:14.980
So we already know that one of these students passed the exam.

04:15.380 --> 04:18.950
We can find out which one was that with a very simple condition.

04:19.760 --> 04:25.280
But in order to do that, we have to pass another if statement inside the elusive statement.

04:26.270 --> 04:32.840
The student who has passed an exam obviously has to have higher score than the other one.

04:34.730 --> 04:38.930
So write it as the condition if score of John.

04:40.310 --> 04:43.490
Is greater than Scott off Nick,

04:46.580 --> 04:53.690
then running cons. the text, and it is John with.

04:56.150 --> 05:01.190
Place here, the variable score of John Plus points.

05:04.500 --> 05:11.130
So if John has the higher score, then this condition will be true and we will get in council, John,

05:11.130 --> 05:11.900
with it's score.

05:13.020 --> 05:18.080
If not, then we need the following statement, right?

05:18.090 --> 05:19.050
Cancel that log.

05:21.280 --> 05:24.490
And it is Nick with.

05:26.960 --> 05:32.030
Place your score of Nick and then again points.

05:36.040 --> 05:43.660
All right, we can say that the task is almost done, let's reload the page and see that we have one

05:43.660 --> 05:47.710
of the students passed and it is John with eight points.

05:49.670 --> 05:55.190
The last thing that we are going to do is to test all the possible cases, suppose that Nick has also

05:55.190 --> 06:01.040
passed the exam so right as the value of scores of Nick, for example, 75.

06:02.950 --> 06:10.560
Then reload and you see that both of them past the next case we have already seen, so let's skip it.

06:11.470 --> 06:22.690
And now suppose that John felt and past so right 49 to this core of John and reload, you see that we

06:22.690 --> 06:23.530
have Nick here.

06:23.950 --> 06:28.840
And the last possible case is that when both of them have felt so right.

06:29.230 --> 06:33.370
Forty five for Nick reload.

06:33.640 --> 06:37.960
And you see the result from our statement both of the students felt.

06:39.710 --> 06:45.920
All right, the task is done, I hope that you have enjoyed it throughout the course, we will make

06:45.920 --> 06:47.740
more and more interesting coding tests.

06:48.380 --> 06:51.350
And now, as I promised, a little quiz is waiting for you.

06:51.770 --> 06:53.390
Let's go ahead and check your knowledge.

06:53.540 --> 06:54.050
Good luck.
