1
00:00:00,120 --> 00:00:04,800
It's OK as you can see here now this checkbox is checked.

2
00:00:04,800 --> 00:00:10,730
So as you can see first I actually created a boolean variable called Am I healthy.

3
00:00:11,100 --> 00:00:14,370
And then I assigned the value false to my variable OK.

4
00:00:14,520 --> 00:00:19,450
So now as you can see here I assigned the value falls to my body.

5
00:00:19,740 --> 00:00:27,360
And then I created an if statement here and inside the apprentice's of this statement I specified that

6
00:00:27,420 --> 00:00:28,890
if the value of this.

7
00:00:28,890 --> 00:00:35,670
Am I healthy valuable OK it is true then execute this line of code here inside of these inside of these

8
00:00:35,670 --> 00:00:36,650
curly braces.

9
00:00:36,720 --> 00:00:41,300
And then as you can see I created another Else statement here else.

10
00:00:41,340 --> 00:00:43,070
If the value of this.

11
00:00:43,100 --> 00:00:45,700
Am I healthy valuable is not true.

12
00:00:45,900 --> 00:00:49,570
Then execute this line of code inside of these curly braces.

13
00:00:49,650 --> 00:00:50,640
So as you can see here.

14
00:00:50,780 --> 00:00:55,040
Now as you can see this checkbox is checked so it is.

15
00:00:55,050 --> 00:00:57,950
So it has actually executed this line of code here.

16
00:00:57,960 --> 00:01:00,240
OK I see it as healthy no.

17
00:01:00,540 --> 00:01:04,440
So this object is 6 x helping No Dot said check it.

18
00:01:04,440 --> 00:01:08,540
True as you can see it is now checked OK.

19
00:01:08,700 --> 00:01:10,170
So hopefully that makes sense.

20
00:01:10,170 --> 00:01:17,970
And now let's actually comment out these lines of code here because I want to actually show you another

21
00:01:17,970 --> 00:01:20,760
important point about Boolean expressions.

22
00:01:20,760 --> 00:01:29,130
Now let's actually create an integer variable so int and the name of this variable is for example power.

23
00:01:29,580 --> 00:01:35,400
And then I assign a value to this variable for example number 70.

24
00:01:35,700 --> 00:01:39,840
And now I can actually assign another value to this.

25
00:01:39,840 --> 00:01:41,250
Am I healthy valuable.

26
00:01:41,400 --> 00:01:43,020
So am I healthy.

27
00:01:43,120 --> 00:01:44,780
Assignment operator.

28
00:01:44,790 --> 00:01:48,180
So let's actually put in a pair of hand brackets here.

29
00:01:48,510 --> 00:01:52,280
So as you know this this variable is actually a boolean variable.

30
00:01:52,320 --> 00:01:57,310
So we need to actually assign a value true or false to this variable.

31
00:01:57,330 --> 00:02:03,150
So I can just create a boolean expression and then assign the result of that set of that expression

32
00:02:03,540 --> 00:02:04,660
to this variable.

33
00:02:04,890 --> 00:02:09,420
So inside Apprentice's again just typing power is greater than 70.

34
00:02:09,480 --> 00:02:10,040
OK.

35
00:02:10,260 --> 00:02:16,110
So as you can see here I actually referred to the name of these boolean valuable and then I assigned

36
00:02:16,170 --> 00:02:18,610
this expression to display in variable.

37
00:02:18,600 --> 00:02:21,170
Ok power is greater than 70.

38
00:02:21,270 --> 00:02:28,080
So if the value of this expression evaluates to true that true value is going to be assigned to this

39
00:02:28,130 --> 00:02:29,600
and my help we worry about it.

40
00:02:29,670 --> 00:02:37,360
But if this expression evaluates to false that's false value is going to be assigned to this.

41
00:02:37,380 --> 00:02:38,580
Am I healthy valuable.

42
00:02:38,630 --> 00:02:41,990
OK so if the value of this power variable.

43
00:02:42,120 --> 00:02:46,310
Ok as you can see this is our power value is greater than 70.

44
00:02:46,590 --> 00:02:54,630
OK then as you can see the value of this expression evaluates to true and then that true value is going

45
00:02:54,630 --> 00:02:57,300
to be assigned to this and my healthy body.

46
00:02:57,600 --> 00:03:05,700
But if the value of these are power variable is not greater than 70 as you can see here the value of

47
00:03:05,700 --> 00:03:12,110
this expression evaluates to false and that false value is going to be assigned to this.

48
00:03:12,210 --> 00:03:13,460
Am I help valuable.

49
00:03:13,620 --> 00:03:18,090
So now as you can see the value of this power variable is 70.

50
00:03:18,450 --> 00:03:25,500
And here I am specifying that if the value of this power variable is greater than 70 then this expression

51
00:03:25,500 --> 00:03:26,560
evaluates to true.

52
00:03:26,610 --> 00:03:29,400
But as you can see this value is not greater than 70.

53
00:03:29,400 --> 00:03:32,270
This value is equal to cival 270.

54
00:03:32,340 --> 00:03:38,940
OK so this expression evaluates to false and that's false value is going to be assigned to this am I

55
00:03:38,940 --> 00:03:40,750
have a healthy body but.

56
00:03:40,830 --> 00:03:44,010
So let's actually create another statement here.

57
00:03:44,010 --> 00:03:45,980
If I'm healthy.

58
00:03:46,530 --> 00:03:56,430
So here I am specifying that if the value of this a healthy variable is true OK then execute this line

59
00:03:56,430 --> 00:04:01,150
of code inside of these curly braces so I can just type in C x.

60
00:04:01,270 --> 00:04:02,120
Hello yes.

61
00:04:02,150 --> 00:04:10,170
That said checked through OK and here as you can see I specified that if the value of this am a healthy

62
00:04:10,200 --> 00:04:15,780
variable is true then execute this line of code here inside of these curly braces.

63
00:04:15,780 --> 00:04:19,940
So as you can see I've just referred to the name of this variable.

64
00:04:19,950 --> 00:04:25,980
Ok so by just referring to the name of this boolean variable I am specifying that if the value of that

65
00:04:25,980 --> 00:04:27,700
variable is true or not.

66
00:04:27,730 --> 00:04:30,820
OK so I just refer to the name of this variable.

67
00:04:30,900 --> 00:04:35,430
I am I am saying that if the value is true then execute this line of code.

68
00:04:35,430 --> 00:04:38,920
Else if that value is not true.

69
00:04:38,970 --> 00:04:43,520
So I need to put in an exclamation mark before this variable name.

70
00:04:43,530 --> 00:04:51,000
LS If the value of this variable is not true then execute this line of code inside of these curly braces

71
00:04:51,000 --> 00:04:55,730
C as x Helfen No that said check it.

72
00:04:55,740 --> 00:04:56,310
True.

73
00:04:56,440 --> 00:05:00,870
OK so now let's actually run our project see what happens.

74
00:05:01,070 --> 00:05:06,530
So as you can see here now our application is actually running on this emulator here.

75
00:05:06,740 --> 00:05:07,510
OK.

76
00:05:07,850 --> 00:05:12,710
And as you can see this checkbox is actually checked there's no checkbox.

77
00:05:12,710 --> 00:05:13,070
OK.

78
00:05:13,100 --> 00:05:16,070
First I actually referred to the name of this am I healthy.

79
00:05:16,070 --> 00:05:17,270
Boolean variable.

80
00:05:17,420 --> 00:05:22,450
And then I assigned this expression for this variable and then I actually create it.

81
00:05:22,580 --> 00:05:28,880
And if else statement here if the value of this and I help with variable is true then execute this line

82
00:05:28,880 --> 00:05:29,610
of code.

83
00:05:30,260 --> 00:05:36,710
Or check this checkbox or else if the value of this boolean value is not true.

84
00:05:36,710 --> 00:05:39,570
Executes this line of code and check these checkboxes.

85
00:05:39,590 --> 00:05:40,470
OK.

86
00:05:40,520 --> 00:05:41,900
So hopefully that makes sense.

87
00:05:41,980 --> 00:05:46,830
OK so now let's actually go back inside this main activity that java file here.

88
00:05:46,940 --> 00:05:52,430
And let's actually comment out these lines of code here because I want to actually show you another

89
00:05:53,030 --> 00:05:56,630
important point about Boolean expressions.

90
00:05:56,630 --> 00:05:57,120
OK.

91
00:05:57,350 --> 00:06:03,180
So first let's actually fell to the name of this Am I healthy boolean valuable assignment operator put

92
00:06:03,200 --> 00:06:05,580
in a pair of round brackets here.

93
00:06:06,020 --> 00:06:07,790
So here I can just typing.

94
00:06:07,820 --> 00:06:15,290
And here in say The Apprentice's I can just put in a boolean expression here so I can just type in power

95
00:06:16,580 --> 00:06:26,450
is greater than 70 questionmark OK true Colin Firth's.

96
00:06:26,550 --> 00:06:34,060
OK so as you can see here first of all I actually felt that the name of this Am I healthy boolean value

97
00:06:34,090 --> 00:06:35,000
but OK.

98
00:06:35,380 --> 00:06:41,950
And then I put an assignment operator here and here I actually created a boolean expression and the

99
00:06:41,950 --> 00:06:47,060
result of this boolean expression is going to be assigned to this and we help evaluate it.

100
00:06:47,110 --> 00:06:49,810
So what does this boolean expression do.

101
00:06:49,850 --> 00:06:50,450
You can see here.

102
00:06:50,470 --> 00:06:55,900
First of all I actually referred to the to the name of this power integer variable.

103
00:06:55,920 --> 00:06:56,430
OK.

104
00:06:56,650 --> 00:06:59,810
So and that puts a greater than sign here.

105
00:07:00,040 --> 00:07:01,720
And then I put number 17 here.

106
00:07:01,720 --> 00:07:02,310
OK.

107
00:07:02,470 --> 00:07:10,060
So if the value of this power variable is greater than 70 as you can see question mark if this value

108
00:07:10,060 --> 00:07:11,340
is greater than 70.

109
00:07:11,340 --> 00:07:11,990
Question mark.

110
00:07:11,990 --> 00:07:12,610
True.

111
00:07:12,970 --> 00:07:20,740
So this means if the value of this power integer valuable is greater than 70 or the value that is going

112
00:07:20,740 --> 00:07:23,750
to be assigned to this and I help variable is true.

113
00:07:23,920 --> 00:07:27,170
Otherwise this colon means otherwise ok otherwise.

114
00:07:27,220 --> 00:07:34,420
And this means if the value of this power variable is not greater than 70 the false value is going to

115
00:07:34,420 --> 00:07:35,530
be assigned to this.

116
00:07:35,520 --> 00:07:36,580
Am I healthy valuable.

117
00:07:36,600 --> 00:07:38,340
OK so let me explain again.

118
00:07:38,500 --> 00:07:41,030
First I actually referred to the name of this.

119
00:07:41,050 --> 00:07:42,000
I help you out here.

120
00:07:42,010 --> 00:07:42,620
OK.

121
00:07:42,910 --> 00:07:50,110
And then I put an assignment operator here and then I actually put in a pair of round brackets and then

122
00:07:50,110 --> 00:07:53,830
I actually created a boolean expression inside these prentices.

123
00:07:53,830 --> 00:08:00,830
So here I actually referred to the name of this integer variable power greater than 970.

124
00:08:01,000 --> 00:08:06,100
If the value of this power in digerati is greater than 70.

125
00:08:06,100 --> 00:08:12,430
Question mark if this value is greater than 70 the value that is going to be assigned to this happy

126
00:08:12,430 --> 00:08:14,040
variable is true.

127
00:08:14,170 --> 00:08:17,540
Otherwise this value is going to be false.

128
00:08:17,570 --> 00:08:25,270
OK if the value of this power integer valuable is not greater than 70 the value falls is going to be

129
00:08:25,270 --> 00:08:27,570
assigned to this help with value valuable.

130
00:08:27,670 --> 00:08:31,030
So now let's actually create an if statement.

131
00:08:31,030 --> 00:08:33,020
If Am I healthy.

132
00:08:33,370 --> 00:08:39,130
And then I need to actually open and close my statement by using these curly braces.

133
00:08:39,320 --> 00:08:42,450
H x held for years that said check it.

134
00:08:42,480 --> 00:08:43,290
True.

135
00:08:43,990 --> 00:08:44,620
OK.

136
00:08:44,740 --> 00:08:51,730
And here I am specifying that if the value of this am I help with value but is true then execute this

137
00:08:51,730 --> 00:08:55,470
line of code here and then check this checkbox here.

138
00:08:55,510 --> 00:08:56,710
OK take this up.

139
00:08:56,710 --> 00:08:57,850
Yes checkbox.

140
00:08:58,180 --> 00:09:06,760
But if the value of these power integer value is not greater than 70 this false value is going to be

141
00:09:06,760 --> 00:09:13,270
assigned to this and we help you value it I can't just create an L statement or I can just create an

142
00:09:13,690 --> 00:09:14,760
if statement.

143
00:09:14,970 --> 00:09:15,720
OK.

144
00:09:16,030 --> 00:09:21,630
And then I can say Apprentice's I can't just type in else if not Am I healthy.

145
00:09:22,120 --> 00:09:26,730
And this means the value of this highly variable is false.

146
00:09:27,010 --> 00:09:30,190
OK so c h x.

147
00:09:30,250 --> 00:09:33,550
Helfen note that said checked ok for us.

148
00:09:33,640 --> 00:09:37,250
So now let's actually run our project and see what happens.

149
00:09:37,300 --> 00:09:41,210
And then inside Apprentice's I can I need to actually put into value 2.

150
00:09:41,380 --> 00:09:41,910
OK.

151
00:09:42,070 --> 00:09:47,290
And this means as if the value of this am I help evaluate but is not true.

152
00:09:47,590 --> 00:09:48,780
So it is false.

153
00:09:48,850 --> 00:09:51,880
Then check that C X healthy no checkbox.

154
00:09:52,030 --> 00:09:56,290
OK so now let's actually run our project and see what happens.

155
00:09:56,290 --> 00:10:00,640
So as you can see here now with this checkbox is actually checked.

156
00:10:00,790 --> 00:10:01,340
OK.

157
00:10:01,480 --> 00:10:09,130
So if I actually change the value of this power variable for example to number 97 and if I run my project

158
00:10:09,130 --> 00:10:10,870
again let's see what happens.

