And and then I want to actually show that value to you.
OK.
So here I can just refer to the name of this total of value here.
OK total value assignment operator.
And then I can just again refer to the name of this total value plus integer array sup index.
OK.
So here as you can see first of all I am actually referring to the name of the total value.
Valuable as you can see here this is my total value variable and this variable is actually of type integer.
OK I actually put an assignment operator.
So you want to actually assign a value to this rally.
OK.
And again I referred to the name of this variable.
In order to refer to the value that is inside of this variable OK plus.
OK this is a plus operator integer.
Sub index.
So this integer and a sub index is going to actually give me the values that are actually specific to
the specific index of this array.
OK so for example the first time that this loop is going to be executed the value of this index right
here is zero.
OK.
And then it's going to check this condition and 0 is less than the length of this error.
OK.
As you can see here it's going to actually go inside these for a loop and then it's going up.
Put this number zero here.
OK.
So integer array index 0.
OK because the value of this index is zero OK.
So the value of the integer RASM index is.
Number two this value here is index 0 of this array.
OK so the value of this index 0 of this array is number two.
OK so number two plus number 0 as you can see here number two.
So that's number two is going to be assigned to this total value.
OK.
And the second time that this loop is going to be executed the value of this total value is actually
two.
OK.
So and as you can see here the value of this index value is actually incremented by 1.
So now the value of this index variable is 1 and it's going to again checked this condition.
So index is less than integer read that Len.
That's true.
So it's not actually going to like this for a loop.
And as you can see here now the value of this total value is two.
OK.
So two plus integers are a sub index.
So the value of this index now is number one integer average stock index as you can see the index is
now number one.
So this is index number one here inside this integer array and the value that is inside of the index
one of this integer is number 54.
OK so two plus 54 is 56 and that's 56.
Value is going to be assigned to the total value.
OK.
And then it's going to actually continue executing this follow up until this condition evaluates to
false and the value of this in the index variable is not less than integer R8 of lead.
And then it's going to actually skip this for a loop and then execute the lines of code that are actually
after this for loop OK.
So let's actually output this value.
This total value to the screen and let's see what happens.
The total that said text.
And here I need to actually refer to the name of this total value valuable plus to double quotes in
order to actually convert this value to our string value.
OK.
So that we can see that value here.
Inside of this script.
OK.
So let's actually run our project and see what happens.
Our application is actually running on this emulator here.
And you can see that the total value of the array is free hundred and fifty five.
OK.
We actually added the values of this of this array together and the total value of this array is free.
Hundred and fifty five.
OK.
So let's actually go back and say this content underline in that example and here as you can see I need
to click on this clear cache here and it's actually the doubleclick on the takes.
And actually put a call in here.
And let's actually go back and say this main activity the job of right here and now I want to actually
show you the calculations that are actually being performed behind the screen.
So inside of this for loop I could actually write this statement in an other way.
So let's actually comment out this line of code here and now I can I could just type in total value
plus assignment operator integer array sub index.
So now let's actually run our project and see what happens.
So again as you can see here the total value of the array is three hundred and fifty five.
So this is our value and there is no difference between writing your code like this or this.
OK.
Are these two statements actually produce the same the same value.
But I think writing your quotes in this way is actually more professional.
OK.
So let's actually comment out this line of code here and now I want to actually output the calculations
that are actually being performed behind the screen.
And I want to actually show those calculations to the user.
OK.
So here inside of this for loop.
First of all let's actually instantiate this all takes a string object that actually created inline
20.
So I just need to refer to the name of this object assignment operator.
And then I just need to type in here thinks the calculations that get text got too strange.
OK.
And now I need to actually refer to the name of this to the calculations object to the calculations
that set text and then say The Apprentice's.
First of all I need to actually reverse the name of this all text string object all text plus total
value.
OK.
I referred to the name of this total value variable as you can see here plus two double quotes.
And here I need to actually put in the plus OPERATOR OK.
So that the user can understand what's going on here and I need to actually again put a plus plus operator
again.
So integer array sup index OK plus operator.
And here again I put in two double quotes and inside double quotes.
I just need to put in an equal operator and here as you can see first about a word with the name of
this or text object.
And then I refer to the name of this total value variable plus as you can see this plus is inside the
double code so that the user can see what's going on behind the screen.
OK.
Integer array sub index with this value is the value that is inside of this array.
And that value is related to that specific index of that array.
And then I put another plus operator and then I put two double quotes and instead of double quotes I
put an equal operator here.
OK.
And again this actually puts a plus operator here.
And now let's actually create a newline character so that you can see what's going on here.
And now I want to actually put in an expression here.
OK.
So I just need to put in a pair of round brackets and insert a round brackets.
I can just type in total value.
OK.
Plus assignments operator integer are a sub index integer array sub index so as you can see here this
expression is the same expression that we actually put here.
OK.
Integer array total value plus equal plus assignment operator integer array index.
So you can actually execute this expression this operation here.
OK.
And then it's going can actually assign that value to these.
The calculations that set text here.
OK.
So we don't need to actually execute this line of code here.
So we commented out this line of code here and then we actually put that expression here so that the
user can see what's going on.
OK.
And he is saying that's why the do these set text Meffert that is actually related to these calculations
object.
OK.
So now let's actually run our project and see what happens.
So as you can see here this is our application is actually running on this emulator.
And this is the value of this.
Our total value of the array.
Three hundred and fifty five.
And these are the calculations that are actually being performed behind the screen.
OK.
So as you can see here we actually messed up things a little here.
And in order to solve this problem let's actually go back and say this main activity that over here
and here we need to actually putting a plus.
OPERATOR OK.
Two double quotes and instead of double quotes I just need to put in a new line character OK.
So that's the importance of actually using a newline character in your application.
OK.
So let's actually go on our project and see what happens.
So again as you can see here our application is actually running on this emulator.
And this is the total value of the array free hundred and fifty five.
And these are the calculations that are actually being performed behind the screen.
OK so let me actually explain here what's going on.