1 00:00:00,870 --> 00:00:09,840 In this lecture we are going to implement a very simple if statement that will clear the default zero 2 00:00:12,270 --> 00:00:12,980 at the moment. 3 00:00:12,990 --> 00:00:16,950 We've got a default zero in the result box here. 4 00:00:17,430 --> 00:00:22,380 So any of the kids will click gets added on to the zero. 5 00:00:22,410 --> 00:00:29,910 So what we're going to do in this lecture here will implement a simple if statement that will clear 6 00:00:29,910 --> 00:00:34,580 the zero when you input any of the keys to numeric keys. 7 00:00:34,590 --> 00:00:36,090 That's all right. 8 00:00:36,120 --> 00:00:38,970 So let's go ahead and start to implement that. 9 00:00:39,360 --> 00:00:48,120 So I'm going to implement that just above this button here. 10 00:00:48,120 --> 00:00:50,900 All right let's implement that somewhere here. 11 00:00:50,920 --> 00:00:52,570 Someone would say if 12 00:00:55,570 --> 00:01:04,650 if the result box which is you the result of the computed numbers. 13 00:01:04,680 --> 00:01:12,660 So when you click on the PS it displays the result box I'm going to say if the result box dot text causes 14 00:01:12,690 --> 00:01:14,790 a text so if the text from that 15 00:01:18,030 --> 00:01:25,450 is treated as equals to what you're doing when you're checking conditions you use double equals to a 16 00:01:25,470 --> 00:01:31,770 single equals two is used to assign a value double equals to compares something. 17 00:01:32,070 --> 00:01:39,090 So I'm saying in the result box of text if the text from that result box is strictly equal to zero 18 00:01:42,790 --> 00:01:45,850 need to specify what will happen then what will happen. 19 00:01:46,590 --> 00:01:47,940 I need to specify here. 20 00:01:47,960 --> 00:01:51,060 So I say is equal to zero and then the result box 21 00:01:55,640 --> 00:02:02,150 I'm attaching a dot clear method so I'm touching it Claire. 22 00:02:03,530 --> 00:02:06,100 If I scrolled through it you can see the method here. 23 00:02:06,110 --> 00:02:08,780 There is a limited set. 24 00:02:08,870 --> 00:02:15,830 So the result box dot Claire put a semicolon. 25 00:02:16,760 --> 00:02:23,710 So what is it will check if the text in the result post is strictly equal to zero. 26 00:02:23,900 --> 00:02:28,760 It will clear that just before you input a button. 27 00:02:29,260 --> 00:02:36,030 So I say that are on the code. 28 00:02:36,560 --> 00:02:37,640 We'll see what happens. 29 00:02:37,640 --> 00:02:40,920 So I expect when I click on any of the buttons. 30 00:02:40,930 --> 00:02:44,180 Now the numeric buttons the Zero should disappear. 31 00:02:44,180 --> 00:02:48,760 So for you say that 5 6. 32 00:02:49,000 --> 00:02:53,290 Not in sadness we don't get the preceding zero. 33 00:02:54,230 --> 00:03:02,000 So that's it for this lecture we've implemented a simple if statement that checks the condition to see 34 00:03:02,000 --> 00:03:09,650 if there is a text or if there is this value is present before you click on the key and it will clear 35 00:03:09,800 --> 00:03:16,980 this before you input any key using the DOT Clay method that's set for this lecture. 36 00:03:17,120 --> 00:03:18,830 Thank you so much for watching. 37 00:03:19,010 --> 00:03:19,570 Bye for now.