I'm sure that you could do this coding task at least tried hard to find the solution, but if not,
let's do it together.
So the first step was to create variables, to present course of exams for John and Nick and set the
values as it.
And 45.
So let's create variables score of John.
Equals to it, and then score of Neek equals to four to five.
The next step is to create the variable, to set the lower limit for passing the exam and assigned to
it the value as 51.
Let's do it right.
Variable plus equals to 51.
All right.
Let's move on to the main part of the task.
Third step tells us the right condition in your statement, which will check if both students have passed
an exam and log the result in council.
So create if statement.
The condition should be the following, if we want to check, if both students have passed an exam that
we had to write a score of John.
Is greater than or equal to pass after that, we have to use logical and operator in order to check
both conditions simultaneously.
So.
Right, and then score of Nick is greater than or equal to pass.
And then in order to display the results in Castle, right, Castle, that log both students passed.
Reload the page and see that we have nothing, as you remember, logical and operator needs to both
conditions to be true.
And because of that, this core of Nick is less than past.
The condition is false.
All right, let's move on to the next step, which tells us to use elusive statement in order to check
if one of the students has passed an exam and locked the resulting castle.
Let's do it right.
Alsup statement with the following condition score of John is greater than or equal to us here.
We need to use logical or operator because it allows us to check if one of the conditions or both of
them are true.
So right, Scott of Knigge is greater than or equal to pass.
And then running council.
One of the students passed reload the page and you see that one of the students passed.
Let's explain what has happened to you.
Because of that, we got the results of LCP statement.
It's proof that only one condition is true in Alsi because if both were true, we would get the results
of its statement and not else.
If, in other words, if the condition of its statement was true, the engine would terminate executing
all remaining Cote's makes sense.
If not, you can post the video and try to figure out on your own.
All right, let's move on to the next step, which asks to use all statements in order to display in
counsel that both students have failed.
It's very simple to do just write your statement and then run and counsel.
Both of the students failed.
All right, the next step is a bit interesting, it tells us the following in case of passing the exam
by one of the students, find out which one was that and this displaying council as an additional information,
the student name and his points.
So we already know that one of these students passed the exam.
We can find out which one was that with a very simple condition.
But in order to do that, we have to pass another if statement inside the elusive statement.
The student who has passed an exam obviously has to have higher score than the other one.
So write it as the condition if score of John.
Is greater than Scott off Nick,
then running cons. the text, and it is John with.
Place here, the variable score of John Plus points.
So if John has the higher score, then this condition will be true and we will get in council, John,
with it's score.
If not, then we need the following statement, right?
Cancel that log.
And it is Nick with.
Place your score of Nick and then again points.
All right, we can say that the task is almost done, let's reload the page and see that we have one
of the students passed and it is John with eight points.
The last thing that we are going to do is to test all the possible cases, suppose that Nick has also
passed the exam so right as the value of scores of Nick, for example, 75.
Then reload and you see that both of them past the next case we have already seen, so let's skip it.
And now suppose that John felt and past so right 49 to this core of John and reload, you see that we
have Nick here.
And the last possible case is that when both of them have felt so right.
Forty five for Nick reload.
And you see the result from our statement both of the students felt.
All right, the task is done, I hope that you have enjoyed it throughout the course, we will make
more and more interesting coding tests.
And now, as I promised, a little quiz is waiting for you.
Let's go ahead and check your knowledge.
Good luck.