Let me actually run my project and see what happens.
So as you can see here it outputs this value to the console.
This is the value of they can buy a car valuable farts.
So as you can see this is the value of my Channa by car value.
OK.
False.
So as you can see here I assigned the value of dollars to my can buy a car variable here.
OK.
And in like 24 I decided to output the value of this variable to the console.
As you can see here.
OK.
So now I want to actually combine expressions together so let's see how we can do that in the previous
example we just created one expression and we assigned the value of this expression to our boolean variable
here.
OK but now I want to actually combine two or three or four expressions together and then assign the
value of those expressions to my variable.
So let's see how we can do that.
You can actually combine unlimited expressions together.
OK.
So now as you can see I want to assign another value to my can by car variable that I created in line
23 can buy car.
OK.
And now I want to combine expressions together and then assign the value of those expressions to my
Tran by card value.
OK.
So now I just need to put emphasis here.
And that inside Apprentice's I want to create an expression.
For example the value of my money valuable is greater than 500.
OK.
So and now I want to actually create another expression how I can do that.
I cannot actually put another emphasis here and then put another explosion inside Apprentice's for example
money is less than 50.
OK.
And put a semicolon at the end of my statement.
So as you can see here is now showing us an error.
Ok it cannot handle this value for us.
So how we can actually deal with this problem we cannot actually put these two expressions together
here and then assign the value of these two expressions to my variable.
So the solution is to use logical operators.
OK this is very important in programming that you should know how to use these logical operators in
your programs.
OK so now you want to actually use the and operator.
So in order to actually use the and operator and combine two expressions together I just need to put
2 and percent symbols between my expressions.
OK.
So as you can see here I put two ampersand symbols between my expressions.
OK so what's the meaning of these two ampersand symbols here.
I am telling the computer that the value of this money valuable must be greater than 500 in order to
evaluate this expression to true.
OK.
So as you can see here the value of my money variable is 100 OK.
And it is not greater than 500.
OK.
So it is less than 500.
One hundred is less than 500.
OK.
So the value of this expression evaluates to false.
So let me actually create a comment here for fots.
OK.
And here as you can see in this expression I am telling the computer that the value of the money variable
must be less than 50 here.
It doesn't make any sense.
So let me actually change this value to 1000 for example.
And here I am telling the computer that the value of the money variable must be less than 1000.
OK.
So as you can see here the value of my money value bet is 100 and it is less than 1000.
So the value of the expression evaluates to TRUE.
OK.
So now Lydney actually outputs the value of this variable to the console and let's see what happens.
So just typing here system that out that princeling.
And then inside the apprentice's I just need to refer to the name of my variable can by car.
OK.
And then at the end of my statement I need to put in a semi-colon OK.
So if I actually run my project as you can see the value of MY can buy charivari about is false here.
OK so now let me actually comment out these lines of code here because I don't want to execute them.
So if I run my project again.
So as you can see it outputs the value of my can buy car valuable to the console for us.
So let's see what's going on here.
As you can see the value of this expression evaluates to false.
Okay.
And the value of the expression evaluates to TRUE.
Okay.
But because we are using the and operator here the value of these two expressions must evaluate to true
in order to evaluate the value of the entire expression to true the value of this expression is false
here and the value of this expression is true.
The value of the entire expression evaluates to false and that false value will be assigned to or can
buy Karadi of it.
OK but so now as you can see the value of all can buy called variable is false.
If you want to for example change the value of my money variable to 600 and if I run my project as you
can see the value of my entire expression evaluates to true.
So now this expression evaluates to TRUE.
OK.
The value of my entire expression evaluates to true and this value is now out to the council.
Okay.
So let me actually explain to you what's going on here.
Here this expression evaluates to true because the value of the money value is greater than 500.
And as you can see I am using the and logical operator here.
OK.
And the value of my money valuable is less than one thousand.
OK.
As you can see the value of my money variable is 600 and it is less than 1000.
So the value of the entire expression evaluates to TRUE.
Okay.
So as you can see in the console the value of my entire expression evaluates to TRUE.
Okay.
But if I change the value of my money variable to 400 OK the value of this expression evaluates to false
again.
OK.
Why.
Because the value of the money variable is less than 500.
OK here I am telling the computer that the value of the money variable must be greater than 500 in order
to actually evaluate the value of the expression to true.
But because the value of the money value is less than 500 as you can see here the value of the expression
evaluates to false.
OK.
And because I am using the ant logical operator here the value of these two expressions must evaluate
to true in order to actually evaluate the entire expression total.
So as you can see in the console the value of my Chan by charivari about is false.
Okay.
And if I for example want to actually put another expression here.
I just need to put him into ampersands and here I can actually put my statement inside Apprentice's
money.
For example less than 900.
OK.
And here I am telling the computer that the value of the money variable must be less than 100.
OK.
In order to actually evaluate the value of this expression to true.
OK.
So now if I run my project as you can see it is false the value of the expression is true because the
value of that money variable is 400 and it is less than 900.
OK so this expression evaluates to true but this expression evaluates to false because we are using
and logical operators here and here the value of these free expressions must be true in order to actually
evaluate the entire expression to true.
OK.
So as you can see if I actually change the value of this value about 2 for example 700 and if I run
my project again the value of my can by car variable evaluates to TRUE.
OK.
Because the entire expression now evaluates to true.
This expression evaluates to true.
This expression evaluates to true as you can see here.
And this expression evaluates to TRUE.
OK.
So now let me actually show you another example about using the OR.
Operator OK.
So let me actually comment out these lines of code here.
OK.