It's OK as you can see here now this checkbox is checked.
So as you can see first I actually created a boolean variable called Am I healthy.
And then I assigned the value false to my variable OK.
So now as you can see here I assigned the value falls to my body.
And then I created an if statement here and inside the apprentice's of this statement I specified that
if the value of this.
Am I healthy valuable OK it is true then execute this line of code here inside of these inside of these
curly braces.
And then as you can see I created another Else statement here else.
If the value of this.
Am I healthy valuable is not true.
Then execute this line of code inside of these curly braces.
So as you can see here.
Now as you can see this checkbox is checked so it is.
So it has actually executed this line of code here.
OK I see it as healthy no.
So this object is 6 x helping No Dot said check it.
True as you can see it is now checked OK.
So hopefully that makes sense.
And now let's actually comment out these lines of code here because I want to actually show you another
important point about Boolean expressions.
Now let's actually create an integer variable so int and the name of this variable is for example power.
And then I assign a value to this variable for example number 70.
And now I can actually assign another value to this.
Am I healthy valuable.
So am I healthy.
Assignment operator.
So let's actually put in a pair of hand brackets here.
So as you know this this variable is actually a boolean variable.
So we need to actually assign a value true or false to this variable.
So I can just create a boolean expression and then assign the result of that set of that expression
to this variable.
So inside Apprentice's again just typing power is greater than 70.
OK.
So as you can see here I actually referred to the name of these boolean valuable and then I assigned
this expression to display in variable.
Ok power is greater than 70.
So if the value of this expression evaluates to true that true value is going to be assigned to this
and my help we worry about it.
But if this expression evaluates to false that's false value is going to be assigned to this.
Am I healthy valuable.
OK so if the value of this power variable.
Ok as you can see this is our power value is greater than 70.
OK then as you can see the value of this expression evaluates to true and then that true value is going
to be assigned to this and my healthy body.
But if the value of these are power variable is not greater than 70 as you can see here the value of
this expression evaluates to false and that false value is going to be assigned to this.
Am I help valuable.
So now as you can see the value of this power variable is 70.
And here I am specifying that if the value of this power variable is greater than 70 then this expression
evaluates to true.
But as you can see this value is not greater than 70.
This value is equal to cival 270.
OK so this expression evaluates to false and that's false value is going to be assigned to this am I
have a healthy body but.
So let's actually create another statement here.
If I'm healthy.
So here I am specifying that if the value of this a healthy variable is true OK then execute this line
of code inside of these curly braces so I can just type in C x.
Hello yes.
That said checked through OK and here as you can see I specified that if the value of this am a healthy
variable is true then execute this line of code here inside of these curly braces.
So as you can see I've just referred to the name of this variable.
Ok so by just referring to the name of this boolean variable I am specifying that if the value of that
variable is true or not.
OK so I just refer to the name of this variable.
I am I am saying that if the value is true then execute this line of code.
Else if that value is not true.
So I need to put in an exclamation mark before this variable name.
LS If the value of this variable is not true then execute this line of code inside of these curly braces
C as x Helfen No that said check it.
True.
OK so now let's actually run our project see what happens.
So as you can see here now our application is actually running on this emulator here.
OK.
And as you can see this checkbox is actually checked there's no checkbox.
OK.
First I actually referred to the name of this am I healthy.
Boolean variable.
And then I assigned this expression for this variable and then I actually create it.
And if else statement here if the value of this and I help with variable is true then execute this line
of code.
Or check this checkbox or else if the value of this boolean value is not true.
Executes this line of code and check these checkboxes.
OK.
So hopefully that makes sense.
OK so now let's actually go back inside this main activity that java file here.
And let's actually comment out these lines of code here because I want to actually show you another
important point about Boolean expressions.
OK.
So first let's actually fell to the name of this Am I healthy boolean valuable assignment operator put
in a pair of round brackets here.
So here I can just typing.
And here in say The Apprentice's I can just put in a boolean expression here so I can just type in power
is greater than 70 questionmark OK true Colin Firth's.
OK so as you can see here first of all I actually felt that the name of this Am I healthy boolean value
but OK.
And then I put an assignment operator here and here I actually created a boolean expression and the
result of this boolean expression is going to be assigned to this and we help evaluate it.
So what does this boolean expression do.
You can see here.
First of all I actually referred to the to the name of this power integer variable.
OK.
So and that puts a greater than sign here.
And then I put number 17 here.
OK.
So if the value of this power variable is greater than 70 as you can see question mark if this value
is greater than 70.
Question mark.
True.
So this means if the value of this power integer valuable is greater than 70 or the value that is going
to be assigned to this and I help variable is true.
Otherwise this colon means otherwise ok otherwise.
And this means if the value of this power variable is not greater than 70 the false value is going to
be assigned to this.
Am I healthy valuable.
OK so let me explain again.
First I actually referred to the name of this.
I help you out here.
OK.
And then I put an assignment operator here and then I actually put in a pair of round brackets and then
I actually created a boolean expression inside these prentices.
So here I actually referred to the name of this integer variable power greater than 970.
If the value of this power in digerati is greater than 70.
Question mark if this value is greater than 70 the value that is going to be assigned to this happy
variable is true.
Otherwise this value is going to be false.
OK if the value of this power integer valuable is not greater than 70 the value falls is going to be
assigned to this help with value valuable.
So now let's actually create an if statement.
If Am I healthy.
And then I need to actually open and close my statement by using these curly braces.
H x held for years that said check it.
True.
OK.
And here I am specifying that if the value of this am I help with value but is true then execute this
line of code here and then check this checkbox here.
OK take this up.
Yes checkbox.
But if the value of these power integer value is not greater than 70 this false value is going to be
assigned to this and we help you value it I can't just create an L statement or I can just create an
if statement.
OK.
And then I can say Apprentice's I can't just type in else if not Am I healthy.
And this means the value of this highly variable is false.
OK so c h x.
Helfen note that said checked ok for us.
So now let's actually run our project and see what happens.
And then inside Apprentice's I can I need to actually put into value 2.
OK.
And this means as if the value of this am I help evaluate but is not true.
So it is false.
Then check that C X healthy no checkbox.
OK so now let's actually run our project and see what happens.
So as you can see here now with this checkbox is actually checked.
OK.
So if I actually change the value of this power variable for example to number 97 and if I run my project
again let's see what happens.