1
00:00:00,270 --> 00:00:03,570
So now they can see our application is actually running on this emulator.

2
00:00:03,570 --> 00:00:08,250
I can change the value of this five stars rating board to another rally.

3
00:00:08,250 --> 00:00:08,760
OK.

4
00:00:08,820 --> 00:00:11,550
I cannot actually interact with these rating boards here.

5
00:00:11,610 --> 00:00:12,360
OK.

6
00:00:12,720 --> 00:00:14,590
So hopefully that makes sense.

7
00:00:15,000 --> 00:00:19,200
And let's actually go back and say this main activity that I have a fight here and here that actually

8
00:00:19,200 --> 00:00:29,400
create five integer variables so int and the name of these variables is five stars.

9
00:00:29,400 --> 00:00:30,790
Review.

10
00:00:31,510 --> 00:00:32,160
Okay.

11
00:00:32,460 --> 00:00:34,640
And then assign the value zero to this variable.

12
00:00:34,710 --> 00:00:43,260
And for starters you again assign the value zero to the sum of the table.

13
00:00:43,410 --> 00:01:00,630
Int free starts review and assign the value zero to this variable int two stars leave you assign a value

14
00:01:00,630 --> 00:01:10,790
zero to this valuable ain't one star review and then assign the value zero to this variable OK.

15
00:01:10,920 --> 00:01:14,910
So as you can see here we have five different integer variables.

16
00:01:15,150 --> 00:01:20,790
And as you can see we assign number zero values zero to these variables here.

17
00:01:20,790 --> 00:01:26,810
OK so now let's actually typing here PTEN results that said Uncle listener.

18
00:01:26,820 --> 00:01:31,680
Now I want to actually make the Spithead results a listener to the clicks that they use and make on

19
00:01:31,700 --> 00:01:32,590
that button.

20
00:01:32,610 --> 00:01:38,000
So inside the practices I can just type in new view that unclick listener OK.

21
00:01:38,040 --> 00:01:42,430
So now instead of this uncle my Meffert I can put my own codes.

22
00:01:42,600 --> 00:01:48,750
So here inside of this uncreate Smurfette and before this certain click listen and Meffert that we actually

23
00:01:48,750 --> 00:01:54,600
called undisputed results here let's actually create an array of integer numbers.

24
00:01:54,600 --> 00:01:55,170
OK.

25
00:01:55,350 --> 00:02:01,950
So first of all I need to actually specify the Data Type of my Abby and and then I need to actually

26
00:02:01,950 --> 00:02:07,970
specify that I want to actually create an array by putting in a pair of brackets after my type name.

27
00:02:08,200 --> 00:02:08,800
OK.

28
00:02:09,210 --> 00:02:12,590
And now I need to actually give my a name.

29
00:02:12,600 --> 00:02:13,470
So just type in here.

30
00:02:13,470 --> 00:02:24,540
Student reviews OK and then put an assignment operator here and then it's actually instantiate dicere

31
00:02:24,640 --> 00:02:27,580
by actually assigning some values to this Aure.

32
00:02:27,600 --> 00:02:32,660
So just putting in an opening curly brace followed by a closing curly brace and then inside of these

33
00:02:32,670 --> 00:02:33,870
curly braces I need to.

34
00:02:33,870 --> 00:02:37,160
I can actually assign some values to this area.

35
00:02:37,170 --> 00:02:37,640
OK.

36
00:02:37,740 --> 00:02:46,360
So for example the review of for the student in index 0 is 5 3 review for the student index.

37
00:02:46,410 --> 00:02:48,200
Number one is free.

38
00:02:48,630 --> 00:03:02,930
For example 4 2 4 5 1 3 2 5 5 free 2 FREE.

39
00:03:03,150 --> 00:03:03,710
OK.

40
00:03:03,840 --> 00:03:06,800
We need to actually put a semicolon at the end of our statement.

41
00:03:06,810 --> 00:03:10,680
So now inside of this uncle FLSA actually creates a for loop.

42
00:03:10,710 --> 00:03:12,050
So just I've been here for.

43
00:03:12,180 --> 00:03:19,190
And then inside Apprentice's Let's actually create a variable in index and then assign the value zero

44
00:03:19,230 --> 00:03:21,490
to this index variable.

45
00:03:21,570 --> 00:03:22,350
OK.

46
00:03:22,710 --> 00:03:28,430
Until index is less than student reviews that Lynn.

47
00:03:28,650 --> 00:03:28,940
OK.

48
00:03:28,950 --> 00:03:35,280
Here we actually created a condition in which this loop is going to be executed the K until the value

49
00:03:35,280 --> 00:03:40,550
of this index variable is less than the the value of the line of these students reviews.

50
00:03:40,560 --> 00:03:40,840
Ari.

51
00:03:40,870 --> 00:03:41,810
OK.

52
00:03:42,310 --> 00:03:45,060
Index plus plus.

53
00:03:45,060 --> 00:03:49,500
So now let's actually open and close this by using these curly braces.

54
00:03:49,950 --> 00:03:56,020
And here inside of this for loop This actually creates an if statement here.

55
00:03:56,070 --> 00:04:02,780
If student reviews sup index is equal.

56
00:04:02,850 --> 00:04:08,310
So as you can see here double equals operator is actually called equal operator in Java.

57
00:04:08,310 --> 00:04:08,770
OK.

58
00:04:08,880 --> 00:04:11,310
So is equal to 5.

59
00:04:11,460 --> 00:04:17,310
So if the value of the students reviews sup index is equal to number five and then there's actually

60
00:04:17,310 --> 00:04:23,460
the open and closed this if statement by using these curly braces plus plus five stars to review.

61
00:04:23,730 --> 00:04:24,380
OK.

62
00:04:24,390 --> 00:04:30,980
And this means add one value to the value of this five star review and then return that value to me.

63
00:04:30,990 --> 00:04:31,540
OK.

64
00:04:31,650 --> 00:04:34,150
As you can see here it is now showing us an error.

65
00:04:34,170 --> 00:04:38,350
The compiler is complaining here and we need to actually fix this error.

66
00:04:38,400 --> 00:04:41,460
But before that let me try to explain this statement here.

67
00:04:41,640 --> 00:04:43,660
Here I am referring to the name of this array.

68
00:04:43,710 --> 00:04:47,220
Student reviews and here in inside the brackets.

69
00:04:47,420 --> 00:04:50,090
I am just referring to the name of this index variable.

70
00:04:50,100 --> 00:04:50,900
OK.

71
00:04:51,360 --> 00:04:55,720
And here I am saying that if student reviews some index.

72
00:04:55,740 --> 00:05:01,900
So for example the first time that this loop is going to be executed the this index value bet is zero.

73
00:05:01,900 --> 00:05:02,580
OK.

74
00:05:02,940 --> 00:05:07,060
So student reviews sub zero as you can see here.

75
00:05:07,070 --> 00:05:09,690
So the value of this index value bet is zero OK.

76
00:05:09,700 --> 00:05:14,330
And this art piece of court is going to actually give me the value that is inside of the index zero

77
00:05:14,350 --> 00:05:16,180
of these students reviews.

78
00:05:16,540 --> 00:05:22,090
So these five this number five is actually at the index zero of these student reviews.

79
00:05:22,210 --> 00:05:22,710
OK.

80
00:05:22,840 --> 00:05:30,610
So here I am telling that if this value is equal to number five then plus plus five stars review.

81
00:05:30,670 --> 00:05:37,730
So this five star review is actually valuable that we actually created here inside these uncreate method.

82
00:05:37,750 --> 00:05:38,620
OK.

83
00:05:39,160 --> 00:05:41,390
And this variabilis of type integer.

84
00:05:41,620 --> 00:05:42,140
OK.

85
00:05:42,340 --> 00:05:48,280
And here we are saying that as increment the value of this variable by one and then return that value

86
00:05:48,280 --> 00:05:48,880
to me.

87
00:05:48,880 --> 00:05:52,260
So now let's actually solve this problem that is occurring here.

88
00:05:52,260 --> 00:05:52,720
OK.

89
00:05:52,900 --> 00:05:56,530
So just hover your mouse pointer over the error area and see what.

90
00:05:56,580 --> 00:06:02,920
And let's see what's the error cannot assign a value to final variable 5 star review.

91
00:06:02,980 --> 00:06:03,600
OK.

92
00:06:03,850 --> 00:06:09,880
So as you can see here are these five star review value bet is actually declared as final.

93
00:06:09,970 --> 00:06:13,040
And this means that this variable is actually a constant.

94
00:06:13,130 --> 00:06:17,270
OK so if I did it this final achievement here let's see what happens.

95
00:06:17,320 --> 00:06:18,990
Again it is showing us an error.

96
00:06:19,120 --> 00:06:24,960
So let's actually hover the mouse pointer over the error area and see what's the error variable.

97
00:06:24,970 --> 00:06:31,050
For starters the review is accessed video in our class needs to be declared final.

98
00:06:31,360 --> 00:06:36,520
So later in this course I'll talk more about in her classes and in anonymous classes.

99
00:06:36,580 --> 00:06:37,000
OK.

100
00:06:37,090 --> 00:06:40,210
But for now remember that this piece of code.

101
00:06:40,210 --> 00:06:43,470
These are lines of code that actually inside another class.

102
00:06:43,690 --> 00:06:48,760
In order to access the value of these valuable we need to actually declare these variables as final.

103
00:06:48,880 --> 00:06:58,090
OK so in and if I actually declare these variables as final I cannot assign any values to these variables

104
00:06:58,250 --> 00:06:59,980
once I assign a value to them.

105
00:06:59,990 --> 00:07:05,620
OK so in order to solve this problem just select all of these variables.

106
00:07:05,680 --> 00:07:06,280
OK.

107
00:07:06,820 --> 00:07:12,710
And then if you are using any of my choices you need to actually hold the Comanche and then press on

108
00:07:13,030 --> 00:07:16,330
the delay the x key on your keyboard in order to cut.

109
00:07:16,390 --> 00:07:21,670
These are statements these lines of code and if you are using a Windows machine you need to actually

110
00:07:21,670 --> 00:07:28,440
hold the control key and then press on the letter X key on your keyboard in order to cut these these

111
00:07:28,570 --> 00:07:29,360
lines of code.

112
00:07:29,500 --> 00:07:36,540
Or you can actually right click on these lines of code and then you can actually cut here.

113
00:07:36,550 --> 00:07:36,990
OK.

114
00:07:37,060 --> 00:07:37,870
As you can see.

115
00:07:37,870 --> 00:07:39,000
Click on that.

116
00:07:39,760 --> 00:07:44,570
And here let's actually put these values inside of this main activity class.

117
00:07:45,020 --> 00:07:45,300
OK.

118
00:07:45,310 --> 00:07:51,490
And here in order to paste those lines of code if you are using of my choice 6 you need to actually

119
00:07:51,490 --> 00:07:55,320
hold the comma and key and then on the leader Vicci on your keyboard.

120
00:07:55,420 --> 00:08:00,310
Or if you are using a Windows machine you need to actually hold the control key and then press and delay

121
00:08:00,320 --> 00:08:01,830
that BICI on your keyboard.

122
00:08:02,020 --> 00:08:05,700
Right click and this area here and then click on paste here.

123
00:08:05,740 --> 00:08:06,690
OK.

124
00:08:07,000 --> 00:08:09,270
So now as you can see the error is gone.

125
00:08:09,560 --> 00:08:13,070
OK let's actually create another if statement here.

126
00:08:13,090 --> 00:08:20,690
If student reviews sup index OK is equal to number four.

127
00:08:20,830 --> 00:08:26,890
So analysis should be open and closed this if statement by using these curly braces inside of this if

128
00:08:26,890 --> 00:08:28,170
statement.

129
00:08:28,300 --> 00:08:32,230
Just typing here plus plus four stars to review.

130
00:08:32,710 --> 00:08:39,400
And here I am saying that if the value that is inside of this specific index of these students reviews

131
00:08:39,730 --> 00:08:47,020
is equal to number four then increment this the value of these for stars review value.

132
00:08:47,070 --> 00:08:50,170
OK this is our Forrestal's review valuable.

133
00:08:50,440 --> 00:08:51,620
OK.

134
00:08:51,940 --> 00:08:54,250
Again let's actually create another if statement.

135
00:08:54,290 --> 00:09:08,200
If student reviews some index is equal to number three it increment the value of the freestylers variable

136
00:09:08,200 --> 00:09:09,640
and then return that value to me.

137
00:09:09,640 --> 00:09:10,240
OK.

138
00:09:10,510 --> 00:09:21,790
If student reviews sup index is equal to number two then increment the value of the twister's review

139
00:09:21,980 --> 00:09:25,630
variable by 1 and then return that value to me.

140
00:09:25,750 --> 00:09:35,620
And if the value of this student reviews sub index is equal to number 1 then increment the value of

141
00:09:35,620 --> 00:09:40,650
the one star review variable by one and then return that value to me.

142
00:09:40,810 --> 00:09:41,410
OK.

143
00:09:41,410 --> 00:09:46,210
So after this for loop as you can see this is the end the curly brace of this for a loop.

144
00:09:46,270 --> 00:09:52,350
OK here now I can actually assign some values to those takes you.

145
00:09:52,370 --> 00:09:55,190
OK I can actually output some values to the screen.

