In this lecture we are going to implement a very simple if statement that will clear the default zero
at the moment.
We've got a default zero in the result box here.
So any of the kids will click gets added on to the zero.
So what we're going to do in this lecture here will implement a simple if statement that will clear
the zero when you input any of the keys to numeric keys.
That's all right.
So let's go ahead and start to implement that.
So I'm going to implement that just above this button here.
All right let's implement that somewhere here.
Someone would say if
if the result box which is you the result of the computed numbers.
So when you click on the PS it displays the result box I'm going to say if the result box dot text causes
a text so if the text from that
is treated as equals to what you're doing when you're checking conditions you use double equals to a
single equals two is used to assign a value double equals to compares something.
So I'm saying in the result box of text if the text from that result box is strictly equal to zero
need to specify what will happen then what will happen.
I need to specify here.
So I say is equal to zero and then the result box
I'm attaching a dot clear method so I'm touching it Claire.
If I scrolled through it you can see the method here.
There is a limited set.
So the result box dot Claire put a semicolon.
So what is it will check if the text in the result post is strictly equal to zero.
It will clear that just before you input a button.
So I say that are on the code.
We'll see what happens.
So I expect when I click on any of the buttons.
Now the numeric buttons the Zero should disappear.
So for you say that 5 6.
Not in sadness we don't get the preceding zero.
So that's it for this lecture we've implemented a simple if statement that checks the condition to see
if there is a text or if there is this value is present before you click on the key and it will clear
this before you input any key using the DOT Clay method that's set for this lecture.
Thank you so much for watching.
Bye for now.