1
00:00:00,350 --> 00:00:02,930
And and then I want to actually show that value to you.

2
00:00:02,970 --> 00:00:03,600
OK.

3
00:00:03,990 --> 00:00:09,130
So here I can just refer to the name of this total of value here.

4
00:00:09,400 --> 00:00:11,830
OK total value assignment operator.

5
00:00:12,180 --> 00:00:19,890
And then I can just again refer to the name of this total value plus integer array sup index.

6
00:00:20,470 --> 00:00:20,930
OK.

7
00:00:21,000 --> 00:00:26,280
So here as you can see first of all I am actually referring to the name of the total value.

8
00:00:26,400 --> 00:00:31,320
Valuable as you can see here this is my total value variable and this variable is actually of type integer.

9
00:00:31,350 --> 00:00:34,990
OK I actually put an assignment operator.

10
00:00:35,040 --> 00:00:37,340
So you want to actually assign a value to this rally.

11
00:00:37,410 --> 00:00:38,080
OK.

12
00:00:38,520 --> 00:00:40,970
And again I referred to the name of this variable.

13
00:00:40,970 --> 00:00:46,530
In order to refer to the value that is inside of this variable OK plus.

14
00:00:46,860 --> 00:00:49,620
OK this is a plus operator integer.

15
00:00:49,750 --> 00:00:50,620
Sub index.

16
00:00:50,640 --> 00:00:56,250
So this integer and a sub index is going to actually give me the values that are actually specific to

17
00:00:56,250 --> 00:00:58,690
the specific index of this array.

18
00:00:58,710 --> 00:01:03,840
OK so for example the first time that this loop is going to be executed the value of this index right

19
00:01:03,840 --> 00:01:04,630
here is zero.

20
00:01:04,650 --> 00:01:05,080
OK.

21
00:01:05,100 --> 00:01:09,200
And then it's going to check this condition and 0 is less than the length of this error.

22
00:01:09,210 --> 00:01:09,640
OK.

23
00:01:09,660 --> 00:01:14,120
As you can see here it's going to actually go inside these for a loop and then it's going up.

24
00:01:14,130 --> 00:01:16,210
Put this number zero here.

25
00:01:16,260 --> 00:01:16,680
OK.

26
00:01:16,720 --> 00:01:18,960
So integer array index 0.

27
00:01:19,080 --> 00:01:21,800
OK because the value of this index is zero OK.

28
00:01:22,050 --> 00:01:25,380
So the value of the integer RASM index is.

29
00:01:25,380 --> 00:01:29,730
Number two this value here is index 0 of this array.

30
00:01:29,870 --> 00:01:34,320
OK so the value of this index 0 of this array is number two.

31
00:01:34,560 --> 00:01:39,340
OK so number two plus number 0 as you can see here number two.

32
00:01:39,450 --> 00:01:42,920
So that's number two is going to be assigned to this total value.

33
00:01:42,960 --> 00:01:43,360
OK.

34
00:01:43,410 --> 00:01:48,330
And the second time that this loop is going to be executed the value of this total value is actually

35
00:01:48,330 --> 00:01:48,700
two.

36
00:01:48,780 --> 00:01:49,470
OK.

37
00:01:49,750 --> 00:01:55,780
So and as you can see here the value of this index value is actually incremented by 1.

38
00:01:55,800 --> 00:02:01,520
So now the value of this index variable is 1 and it's going to again checked this condition.

39
00:02:01,800 --> 00:02:04,690
So index is less than integer read that Len.

40
00:02:04,950 --> 00:02:05,720
That's true.

41
00:02:05,790 --> 00:02:08,400
So it's not actually going to like this for a loop.

42
00:02:08,430 --> 00:02:11,610
And as you can see here now the value of this total value is two.

43
00:02:11,610 --> 00:02:12,130
OK.

44
00:02:12,240 --> 00:02:15,920
So two plus integers are a sub index.

45
00:02:15,960 --> 00:02:21,990
So the value of this index now is number one integer average stock index as you can see the index is

46
00:02:21,990 --> 00:02:22,710
now number one.

47
00:02:22,710 --> 00:02:29,550
So this is index number one here inside this integer array and the value that is inside of the index

48
00:02:30,000 --> 00:02:33,280
one of this integer is number 54.

49
00:02:33,540 --> 00:02:38,460
OK so two plus 54 is 56 and that's 56.

50
00:02:38,580 --> 00:02:41,930
Value is going to be assigned to the total value.

51
00:02:42,090 --> 00:02:42,800
OK.

52
00:02:43,200 --> 00:02:48,930
And then it's going to actually continue executing this follow up until this condition evaluates to

53
00:02:48,930 --> 00:02:55,300
false and the value of this in the index variable is not less than integer R8 of lead.

54
00:02:55,350 --> 00:03:00,180
And then it's going to actually skip this for a loop and then execute the lines of code that are actually

55
00:03:00,180 --> 00:03:01,890
after this for loop OK.

56
00:03:01,890 --> 00:03:04,760
So let's actually output this value.

57
00:03:04,770 --> 00:03:07,950
This total value to the screen and let's see what happens.

58
00:03:08,130 --> 00:03:11,340
The total that said text.

59
00:03:11,490 --> 00:03:16,680
And here I need to actually refer to the name of this total value valuable plus to double quotes in

60
00:03:16,680 --> 00:03:20,070
order to actually convert this value to our string value.

61
00:03:20,070 --> 00:03:20,520
OK.

62
00:03:20,580 --> 00:03:23,380
So that we can see that value here.

63
00:03:23,610 --> 00:03:24,690
Inside of this script.

64
00:03:24,700 --> 00:03:25,090
OK.

65
00:03:25,170 --> 00:03:29,020
So let's actually run our project and see what happens.

66
00:03:29,070 --> 00:03:31,940
Our application is actually running on this emulator here.

67
00:03:32,070 --> 00:03:36,060
And you can see that the total value of the array is free hundred and fifty five.

68
00:03:36,090 --> 00:03:36,480
OK.

69
00:03:36,480 --> 00:03:42,980
We actually added the values of this of this array together and the total value of this array is free.

70
00:03:42,980 --> 00:03:44,110
Hundred and fifty five.

71
00:03:44,160 --> 00:03:44,620
OK.

72
00:03:44,620 --> 00:03:49,230
So let's actually go back and say this content underline in that example and here as you can see I need

73
00:03:49,230 --> 00:03:53,140
to click on this clear cache here and it's actually the doubleclick on the takes.

74
00:03:53,190 --> 00:03:55,860
And actually put a call in here.

75
00:03:55,940 --> 00:04:01,560
And let's actually go back and say this main activity the job of right here and now I want to actually

76
00:04:01,560 --> 00:04:06,510
show you the calculations that are actually being performed behind the screen.

77
00:04:06,510 --> 00:04:11,550
So inside of this for loop I could actually write this statement in an other way.

78
00:04:11,550 --> 00:04:16,800
So let's actually comment out this line of code here and now I can I could just type in total value

79
00:04:18,240 --> 00:04:22,590
plus assignment operator integer array sub index.

80
00:04:22,590 --> 00:04:25,500
So now let's actually run our project and see what happens.

81
00:04:25,500 --> 00:04:31,160
So again as you can see here the total value of the array is three hundred and fifty five.

82
00:04:31,200 --> 00:04:37,560
So this is our value and there is no difference between writing your code like this or this.

83
00:04:37,560 --> 00:04:38,120
OK.

84
00:04:38,220 --> 00:04:41,860
Are these two statements actually produce the same the same value.

85
00:04:41,910 --> 00:04:46,380
But I think writing your quotes in this way is actually more professional.

86
00:04:46,410 --> 00:04:46,920
OK.

87
00:04:46,980 --> 00:04:54,290
So let's actually comment out this line of code here and now I want to actually output the calculations

88
00:04:54,300 --> 00:04:56,510
that are actually being performed behind the screen.

89
00:04:56,550 --> 00:04:59,070
And I want to actually show those calculations to the user.

90
00:04:59,070 --> 00:04:59,500
OK.

91
00:04:59,580 --> 00:05:02,050
So here inside of this for loop.

92
00:05:02,180 --> 00:05:09,170
First of all let's actually instantiate this all takes a string object that actually created inline

93
00:05:09,380 --> 00:05:10,170
20.

94
00:05:10,430 --> 00:05:14,360
So I just need to refer to the name of this object assignment operator.

95
00:05:14,600 --> 00:05:21,500
And then I just need to type in here thinks the calculations that get text got too strange.

96
00:05:21,500 --> 00:05:23,110
OK.

97
00:05:23,120 --> 00:05:29,930
And now I need to actually refer to the name of this to the calculations object to the calculations

98
00:05:30,020 --> 00:05:34,030
that set text and then say The Apprentice's.

99
00:05:34,070 --> 00:05:42,380
First of all I need to actually reverse the name of this all text string object all text plus total

100
00:05:42,380 --> 00:05:44,260
value.

101
00:05:45,340 --> 00:05:46,090
OK.

102
00:05:46,520 --> 00:05:52,530
I referred to the name of this total value variable as you can see here plus two double quotes.

103
00:05:52,640 --> 00:05:58,210
And here I need to actually put in the plus OPERATOR OK.

104
00:05:58,550 --> 00:06:04,790
So that the user can understand what's going on here and I need to actually again put a plus plus operator

105
00:06:04,820 --> 00:06:05,740
again.

106
00:06:06,200 --> 00:06:14,490
So integer array sup index OK plus operator.

107
00:06:15,290 --> 00:06:19,160
And here again I put in two double quotes and inside double quotes.

108
00:06:19,190 --> 00:06:24,740
I just need to put in an equal operator and here as you can see first about a word with the name of

109
00:06:24,740 --> 00:06:26,510
this or text object.

110
00:06:26,650 --> 00:06:32,480
And then I refer to the name of this total value variable plus as you can see this plus is inside the

111
00:06:32,480 --> 00:06:36,380
double code so that the user can see what's going on behind the screen.

112
00:06:36,380 --> 00:06:36,940
OK.

113
00:06:36,950 --> 00:06:42,130
Integer array sub index with this value is the value that is inside of this array.

114
00:06:42,170 --> 00:06:47,110
And that value is related to that specific index of that array.

115
00:06:47,270 --> 00:06:53,210
And then I put another plus operator and then I put two double quotes and instead of double quotes I

116
00:06:53,210 --> 00:06:55,510
put an equal operator here.

117
00:06:55,730 --> 00:06:56,520
OK.

118
00:06:56,930 --> 00:06:59,920
And again this actually puts a plus operator here.

119
00:07:00,230 --> 00:07:05,020
And now let's actually create a newline character so that you can see what's going on here.

120
00:07:05,180 --> 00:07:08,080
And now I want to actually put in an expression here.

121
00:07:08,150 --> 00:07:08,700
OK.

122
00:07:09,050 --> 00:07:14,660
So I just need to put in a pair of round brackets and insert a round brackets.

123
00:07:14,660 --> 00:07:17,000
I can just type in total value.

124
00:07:17,600 --> 00:07:18,250
OK.

125
00:07:18,360 --> 00:07:29,700
Plus assignments operator integer are a sub index integer array sub index so as you can see here this

126
00:07:29,880 --> 00:07:32,740
expression is the same expression that we actually put here.

127
00:07:32,820 --> 00:07:33,250
OK.

128
00:07:33,300 --> 00:07:38,940
Integer array total value plus equal plus assignment operator integer array index.

129
00:07:38,940 --> 00:07:44,460
So you can actually execute this expression this operation here.

130
00:07:44,700 --> 00:07:45,300
OK.

131
00:07:45,300 --> 00:07:47,960
And then it's going can actually assign that value to these.

132
00:07:48,340 --> 00:07:50,370
The calculations that set text here.

133
00:07:50,400 --> 00:07:50,940
OK.

134
00:07:51,120 --> 00:07:55,420
So we don't need to actually execute this line of code here.

135
00:07:55,470 --> 00:08:02,160
So we commented out this line of code here and then we actually put that expression here so that the

136
00:08:02,160 --> 00:08:04,030
user can see what's going on.

137
00:08:04,230 --> 00:08:04,780
OK.

138
00:08:04,890 --> 00:08:10,260
And he is saying that's why the do these set text Meffert that is actually related to these calculations

139
00:08:10,320 --> 00:08:10,720
object.

140
00:08:10,740 --> 00:08:11,190
OK.

141
00:08:11,250 --> 00:08:14,280
So now let's actually run our project and see what happens.

142
00:08:14,280 --> 00:08:20,000
So as you can see here this is our application is actually running on this emulator.

143
00:08:20,190 --> 00:08:21,510
And this is the value of this.

144
00:08:21,540 --> 00:08:22,800
Our total value of the array.

145
00:08:22,800 --> 00:08:24,520
Three hundred and fifty five.

146
00:08:24,750 --> 00:08:29,430
And these are the calculations that are actually being performed behind the screen.

147
00:08:29,430 --> 00:08:29,920
OK.

148
00:08:30,090 --> 00:08:33,460
So as you can see here we actually messed up things a little here.

149
00:08:33,870 --> 00:08:38,330
And in order to solve this problem let's actually go back and say this main activity that over here

150
00:08:38,400 --> 00:08:41,100
and here we need to actually putting a plus.

151
00:08:41,100 --> 00:08:42,920
OPERATOR OK.

152
00:08:43,410 --> 00:08:47,870
Two double quotes and instead of double quotes I just need to put in a new line character OK.

153
00:08:47,970 --> 00:08:52,990
So that's the importance of actually using a newline character in your application.

154
00:08:53,010 --> 00:08:53,570
OK.

155
00:08:53,850 --> 00:08:56,970
So let's actually go on our project and see what happens.

156
00:08:56,970 --> 00:09:01,600
So again as you can see here our application is actually running on this emulator.

157
00:09:01,860 --> 00:09:05,900
And this is the total value of the array free hundred and fifty five.

158
00:09:06,180 --> 00:09:10,260
And these are the calculations that are actually being performed behind the screen.

159
00:09:10,300 --> 00:09:13,840
OK so let me actually explain here what's going on.

