1
00:00:00,450 --> 00:00:03,260
Plus plus clearance sup response.

2
00:00:03,330 --> 00:00:05,700
Let me explain what's going on.

3
00:00:05,700 --> 00:00:10,820
For the first time that this group is going to be executed the value of this response variable is zero.

4
00:00:10,820 --> 00:00:11,290
OK.

5
00:00:11,460 --> 00:00:18,930
And this loop is going to be executed onto the value of this response to valuable is less than the value

6
00:00:18,930 --> 00:00:22,030
of the land of these people rates every day.

7
00:00:22,040 --> 00:00:23,150
So as you can see here.

8
00:00:23,210 --> 00:00:36,350
So let's actually see what's the length of these people rates are 3 1 2 3 4 5 6 7 8 9 10 11 12 13.

9
00:00:36,420 --> 00:00:40,610
So the length of these people rates really is 15.

10
00:00:40,620 --> 00:00:41,060
OK.

11
00:00:41,160 --> 00:00:48,050
And here you are saying that until the value of this response variable is less than 15.

12
00:00:48,230 --> 00:00:51,200
OK execute this for loop here.

13
00:00:51,540 --> 00:00:57,680
So by the time that the value of the respond value reaches number six.

14
00:00:57,680 --> 00:01:05,190
OK That's number six is going to actually go inside of these brackets here and then it's going to actually

15
00:01:05,190 --> 00:01:11,790
go inside of this occurrence Aure and then it's going at it it wants to actually access the value that

16
00:01:11,790 --> 00:01:17,040
is inside of the index 6 index number six of these three.

17
00:01:17,130 --> 00:01:21,200
So we don't have index number six in this area here.

18
00:01:21,300 --> 00:01:21,720
OK.

19
00:01:21,840 --> 00:01:28,080
So we cannot actually access the value that is inside of the index number six of this very ok because

20
00:01:28,110 --> 00:01:33,710
as you can see these are the values of these are these are the indexes of this houri.

21
00:01:33,730 --> 00:01:33,980
OK.

22
00:01:34,080 --> 00:01:36,800
0 1 2 3 4 5.

23
00:01:36,890 --> 00:01:37,350
We cannot.

24
00:01:37,410 --> 00:01:43,220
You can only access the values that are inside of only these indexes.

25
00:01:43,230 --> 00:01:43,700
OK.

26
00:01:43,890 --> 00:01:47,060
So index number 6 doesn't exist as a result.

27
00:01:47,100 --> 00:01:53,820
You actually see this error here Arey out of bounds exception and that's why our application actually

28
00:01:53,820 --> 00:01:54,580
crashed.

29
00:01:54,720 --> 00:01:55,410
OK.

30
00:01:55,860 --> 00:02:02,400
So in order to solve this error here first of all it naturally comment out this these numbers here and

31
00:02:02,400 --> 00:02:09,550
here inside of these brackets we just need to refer to the name of these people at rates Aure people

32
00:02:09,850 --> 00:02:14,450
rates are cheap brackets keep people rates up.

33
00:02:14,470 --> 00:02:16,220
Respond.

34
00:02:17,260 --> 00:02:17,850
OK.

35
00:02:18,130 --> 00:02:22,340
And in this way it's going to actually go inside these people rates Ali.

36
00:02:22,490 --> 00:02:23,340
OK.

37
00:02:23,380 --> 00:02:30,070
And then it's going to actually give me the value that is inside of these or respond index.

38
00:02:30,070 --> 00:02:35,560
So for example for the first time that this group is going to be executed and the value of this respond

39
00:02:35,560 --> 00:02:36,520
valuable is zero.

40
00:02:36,520 --> 00:02:37,170
OK.

41
00:02:37,300 --> 00:02:40,810
So here for example the value of this response variable is zero.

42
00:02:40,810 --> 00:02:45,040
People rates Sub Zero is going to ask you to give me devalue number one.

43
00:02:45,220 --> 00:02:45,900
OK.

44
00:02:46,270 --> 00:02:51,720
And that number one is going to actually replace this piece of code here.

45
00:02:51,970 --> 00:02:57,780
As you can see so here we have we have actually that actually create a comment here number one.

46
00:02:57,880 --> 00:02:58,540
OK.

47
00:02:58,840 --> 00:03:01,300
So this value is number one now.

48
00:03:01,330 --> 00:03:05,080
So here we have plus plus occurrence number one.

49
00:03:05,140 --> 00:03:06,590
Plus inside the brackets.

50
00:03:06,610 --> 00:03:07,350
OK.

51
00:03:07,360 --> 00:03:10,300
So it's going to go inside the occurrence Aure here.

52
00:03:10,330 --> 00:03:18,400
As you can see and it is going to give me the value that is inside of the index number of one of these

53
00:03:18,490 --> 00:03:19,110
arii.

54
00:03:19,300 --> 00:03:19,860
OK.

55
00:03:19,900 --> 00:03:25,570
And then it's going to actually increment that value by one and then it's going to actually return that

56
00:03:25,570 --> 00:03:26,680
value to me.

57
00:03:26,710 --> 00:03:27,180
OK.

58
00:03:27,370 --> 00:03:32,350
Plus plus occurrence Sup people rates some respond.

59
00:03:32,770 --> 00:03:34,960
OK let me you to explain again here.

60
00:03:35,170 --> 00:03:41,410
So for the second time that this loop is going to be executed the value of this respon variable is number

61
00:03:41,440 --> 00:03:41,620
one.

62
00:03:41,640 --> 00:03:42,310
OK.

63
00:03:42,740 --> 00:03:48,260
So this month plus plus here as you can see it is going to actually increment the value of this respond

64
00:03:48,290 --> 00:03:51,910
variable by one after each execution of this world.

65
00:03:52,090 --> 00:03:55,050
So now the value of this response valuable is one.

66
00:03:55,330 --> 00:03:57,620
So now it's going to go inside of this for a loop.

67
00:03:57,820 --> 00:04:01,550
And here the value of this respon variable is one.

68
00:04:01,570 --> 00:04:04,260
So here we have people rates sub 1.

69
00:04:04,330 --> 00:04:04,980
OK.

70
00:04:05,050 --> 00:04:11,290
So it's going to go inside of the index number of one of these people rates are the index and the value

71
00:04:11,290 --> 00:04:14,660
of the index number of one of these people rates our rate is fourth.

72
00:04:14,710 --> 00:04:15,140
OK.

73
00:04:15,220 --> 00:04:16,600
Disvalue.

74
00:04:16,600 --> 00:04:20,440
So here we have number four inside of the brackets.

75
00:04:20,470 --> 00:04:24,210
So now we have plus plus occurrence Suppe number four.

76
00:04:24,250 --> 00:04:24,930
OK.

77
00:04:24,940 --> 00:04:29,900
So now we have number four inside of the brackets of these Acura unsorry.

78
00:04:30,280 --> 00:04:36,470
So now it's going to go inside of the index number for all of these occurrence.

79
00:04:36,760 --> 00:04:39,040
And then it's going to actually increment.

80
00:04:39,040 --> 00:04:43,310
That's where you Boivin and then it's going to return that value to me.

81
00:04:43,650 --> 00:04:44,580
OK.

82
00:04:45,250 --> 00:04:47,300
So hopefully that makes sense.

83
00:04:47,470 --> 00:04:52,240
And let's actually do our project again and see what happens.

84
00:04:52,240 --> 00:04:59,110
So now as you can see our application launched successfully and here we can see the values here.

85
00:04:59,110 --> 00:05:02,200
Rates number of stars here as you can see.

86
00:05:02,200 --> 00:05:09,550
So as you can see here for the rate number one we have two people with one star value and for the rate

87
00:05:09,550 --> 00:05:14,180
number two we have two people with two stars of value we have.

88
00:05:14,260 --> 00:05:20,320
And for the rate number three for example we have two people we are freestylers value for their rates.

89
00:05:20,320 --> 00:05:24,840
Number four we have free people with a forestalls value.

90
00:05:24,970 --> 00:05:30,570
And for the right for the right for example Number five we have four people need five stars value.

91
00:05:30,580 --> 00:05:31,150
OK.

92
00:05:31,630 --> 00:05:37,930
So now as you can see here you are actually reading the values that are actually inside of these people

93
00:05:37,930 --> 00:05:38,380
rates.

94
00:05:38,800 --> 00:05:39,300
Okay.

95
00:05:39,370 --> 00:05:44,780
And as you can see here inside of these people rates are a you have this value here five.

96
00:05:45,010 --> 00:05:46,560
Again we have this value 5.

97
00:05:46,560 --> 00:05:52,720
Here again we have this value of five here and this value five here as you can see for the rate number

98
00:05:52,720 --> 00:05:53,390
five.

99
00:05:53,410 --> 00:05:56,530
We have four people with five star value.

100
00:05:56,530 --> 00:05:57,020
OK.

101
00:05:57,130 --> 00:06:00,710
So if your actual reading devalues that are actually inside of this area.

102
00:06:00,790 --> 00:06:05,890
So let's I should go I can say this content others like me in that example and here let's actually click

103
00:06:05,920 --> 00:06:12,950
on this clear cut chest here and essentially change the text of this takes you to a number of people.

104
00:06:12,950 --> 00:06:13,310
OK.

105
00:06:13,390 --> 00:06:14,640
Number of people.

106
00:06:14,730 --> 00:06:20,350
And inside of this mine activity that will here as you can see it's actually on our project again and

107
00:06:20,350 --> 00:06:21,400
see what happens.

108
00:06:21,400 --> 00:06:26,630
So as you can see here now are up our application is actually running on this emulator.

109
00:06:26,980 --> 00:06:29,230
And here we can see these values here.

110
00:06:29,220 --> 00:06:29,730
Okay.

111
00:06:29,800 --> 00:06:35,000
So we have for the rates number one we have for example to people with monster value and so on.

112
00:06:35,000 --> 00:06:35,760
OK.

113
00:06:36,160 --> 00:06:37,910
So hopefully that makes sense.

114
00:06:38,220 --> 00:06:44,230
And here let's actually add another value to these people rates right here.

115
00:06:44,230 --> 00:06:44,740
OK.

116
00:06:44,800 --> 00:06:52,310
So here just putting a comma here and here just you can actually put number 6 here for example.

117
00:06:52,630 --> 00:06:56,960
And now let's actually run our project and see what happens.

118
00:06:57,120 --> 00:06:59,290
That may actually deleted this comment here.

119
00:06:59,710 --> 00:07:01,420
And let's actually do our project.

120
00:07:01,450 --> 00:07:04,790
So as you can see here our application is actually crashed.

121
00:07:04,810 --> 00:07:05,390
OK.

122
00:07:05,480 --> 00:07:12,660
Unfortunately at 17 has stopped and this means that that our application actually crashed and we have

123
00:07:12,660 --> 00:07:13,930
a problem in our codes.

124
00:07:13,950 --> 00:07:14,500
OK.

125
00:07:14,670 --> 00:07:21,780
So as you can see here inside the log it says don't bother to learn that Arey index out of bounds exception.

126
00:07:21,780 --> 00:07:27,100
Again if you're actually getting the same error that we got earlier in this tutorial.

127
00:07:27,150 --> 00:07:28,510
OK Len.

128
00:07:28,570 --> 00:07:30,930
Len for six index six.

129
00:07:30,930 --> 00:07:31,600
OK.

130
00:07:31,770 --> 00:07:37,500
So in the main activity that you will find here actually assigned another value to these people rates

131
00:07:37,890 --> 00:07:40,380
are a hit as you can see this is number six.

132
00:07:40,380 --> 00:07:40,870
OK.

133
00:07:41,040 --> 00:07:44,400
Let me ask you to explain what's going on here inside of this for loop.

134
00:07:44,400 --> 00:07:44,880
OK.

135
00:07:45,090 --> 00:07:51,660
So for example inside of this for loop I actually created an integer number and it has a variable.

136
00:07:51,750 --> 00:07:52,470
OK.

137
00:07:52,890 --> 00:07:55,690
And the name of this integer variable is respon OK.

138
00:07:55,710 --> 00:07:58,390
And then I assign the value zero to this variable.

139
00:07:58,470 --> 00:08:03,810
And here I actually created a condition that actually determines that whether this group is going to

140
00:08:03,810 --> 00:08:05,310
be executed or not.

141
00:08:05,390 --> 00:08:06,090
OK.

142
00:08:06,330 --> 00:08:10,680
So for example the value of this response variable is for that for the first time is zero.

143
00:08:10,680 --> 00:08:16,410
This loop is going to be executed until the value of this responder variable is less than the value

144
00:08:16,410 --> 00:08:19,520
of the land of these people rates are that people rates.

145
00:08:19,590 --> 00:08:25,200
OK so now the value of the length of these people rates rate is 14.

146
00:08:25,340 --> 00:08:25,910
OK.

147
00:08:26,800 --> 00:08:32,250
So now inside of this for loop for the first time the value of this respon value bet is zero.

148
00:08:32,320 --> 00:08:32,770
OK.

149
00:08:32,860 --> 00:08:33,690
It's going to actually go.

150
00:08:33,730 --> 00:08:39,910
This value is going to be inside of the brackets of these people rates are here as you can see people

151
00:08:39,910 --> 00:08:41,050
rates respond.

152
00:08:41,230 --> 00:08:45,020
So it's going to actually go inside of the index zero of these people rates away.

153
00:08:45,100 --> 00:08:49,410
So the value of the index zero of these people it really is number one.

154
00:08:49,630 --> 00:08:50,080
OK.

155
00:08:50,230 --> 00:08:52,420
So it's going to give me the value.

156
00:08:52,420 --> 00:08:53,710
Number one here.

157
00:08:53,890 --> 00:08:59,980
So now we have number the value number of one inside the brackets of this occurrence.

158
00:09:00,210 --> 00:09:00,790
OK.

159
00:09:01,240 --> 00:09:05,060
So plus plus carrots sup number one.

160
00:09:05,140 --> 00:09:05,670
OK.

161
00:09:05,920 --> 00:09:11,980
So the value that is inside of the index number of one of these occasions Arey is for example zero.

162
00:09:12,070 --> 00:09:12,670
OK.

163
00:09:12,940 --> 00:09:15,580
So that is going to actually increment that value by one.

164
00:09:15,700 --> 00:09:16,090
OK.

165
00:09:16,120 --> 00:09:20,670
And this group is going to actually continue executing until it reaches this value.

166
00:09:20,680 --> 00:09:21,030
OK.

167
00:09:21,040 --> 00:09:26,270
Number six this number six is the last value that is inside of the people rates Ali.

168
00:09:26,280 --> 00:09:26,760
Ali.

169
00:09:26,770 --> 00:09:27,380
OK.

170
00:09:27,430 --> 00:09:33,070
So let's actually count the values that are actually inside of the people rates are a zero.

171
00:09:33,250 --> 00:09:33,820
OK.

172
00:09:34,030 --> 00:09:50,110
One two three four five six seven eight nine 10 11 12 13 OK.

173
00:09:50,200 --> 00:09:56,240
So this value is actually at the index Fourteen of these people rates are a.

174
00:09:56,430 --> 00:10:02,920
Ok this number six is actually at the index fifteen of these people rates are a.

