1
00:00:00,270 --> 00:00:06,150
So now let me actually comment out these lines of code here and then I'm gonna actually paste some more

2
00:00:06,150 --> 00:00:07,060
lines of code here.

3
00:00:07,170 --> 00:00:12,780
So first of all let's actually comment out these lines of code just create a multiline comment here

4
00:00:12,870 --> 00:00:14,010
as you can see here.

5
00:00:14,040 --> 00:00:14,740
Right.

6
00:00:14,850 --> 00:00:20,070
And now I'm going to paste in some lines of code here and then I'm going to explain to you what's going

7
00:00:20,070 --> 00:00:20,970
on here.

8
00:00:21,270 --> 00:00:25,840
So as you can see here these are two lines of code that I pasted here.

9
00:00:25,950 --> 00:00:29,100
So as you can see we have actually another statement here.

10
00:00:29,110 --> 00:00:30,790
So if it's value.

11
00:00:30,900 --> 00:00:33,130
So here I am referring to our integer value.

12
00:00:33,140 --> 00:00:38,900
But as you can see here we actually created this integer variable in line number 28 it value.

13
00:00:38,910 --> 00:00:43,210
And as you can see here we are actually getting the value of this textfield.

14
00:00:43,320 --> 00:00:45,920
As you can see here the value of these takes with value.

15
00:00:46,380 --> 00:00:49,080
Is it the number that takes the plus string right.

16
00:00:49,080 --> 00:00:54,480
So here I am actually getting the value of this EDT number and here I am actually converting this value

17
00:00:54,480 --> 00:00:55,690
to a string value.

18
00:00:55,920 --> 00:01:01,660
And here I am assigning that value that string value is valuable which is of type string text field

19
00:01:01,680 --> 00:01:03,990
value and line number 28.

20
00:01:04,020 --> 00:01:09,390
I actually created an idea but after integer and the name is into the right and that I put an assignment

21
00:01:09,390 --> 00:01:15,540
operator here and then here I want to actually convert the value of this string value textfield value

22
00:01:15,720 --> 00:01:17,110
to an integer value.

23
00:01:17,130 --> 00:01:20,740
So integer that parse it takes its value right.

24
00:01:20,760 --> 00:01:25,590
So in this way I can actually convert a string value to an integer value.

25
00:01:25,590 --> 00:01:31,240
So I just referred to the name of this integer class and I called the Smurfette parse.

26
00:01:31,350 --> 00:01:35,750
On this class and then I actually passed this value to the Smurfette.

27
00:01:36,030 --> 00:01:40,550
And here is I try to convert that value tway to an integer value and then this can actually be assigned

28
00:01:40,620 --> 00:01:43,140
as value to do this into value valuable.

29
00:01:43,530 --> 00:01:50,460
And now here I am saying that if its value is actually greater than 90 then we are going to assign this

30
00:01:50,460 --> 00:01:53,160
value to this result by the bell which is of type strength.

31
00:01:53,220 --> 00:01:53,840
So result.

32
00:01:53,850 --> 00:02:01,710
Assignment operator your grade is a and your number is Plus its value as if its value is actually greater

33
00:02:01,710 --> 00:02:02,600
than 80.

34
00:02:02,610 --> 00:02:03,210
Result.

35
00:02:03,210 --> 00:02:08,340
Assignment operator your grade is B and your number is Plus into value.

36
00:02:08,490 --> 00:02:13,150
If your grade is actually else into value is actually greater than 70.

37
00:02:13,170 --> 00:02:13,980
Result.

38
00:02:13,980 --> 00:02:18,560
Assignment operator your grade is c and your number is in value.

39
00:02:18,560 --> 00:02:25,680
Else if value is actually greater than 6 the result assignment operator your grade is F and your number

40
00:02:25,680 --> 00:02:26,840
is into value.

41
00:02:27,060 --> 00:02:32,640
And here we have actually an L statement so if none of the conditions above are actually true as you

42
00:02:32,640 --> 00:02:33,170
can see here.

43
00:02:33,180 --> 00:02:38,050
If none of the conditions above is true then it's going to execute this statement else.

44
00:02:38,220 --> 00:02:38,890
Result.

45
00:02:39,060 --> 00:02:41,280
Assignment operator you are not accepted.

46
00:02:41,580 --> 00:02:42,040
Right.

47
00:02:42,210 --> 00:02:44,940
And finally you are actually setting the value you have.

48
00:02:44,940 --> 00:02:46,890
These are two ways to resolve.

49
00:02:46,910 --> 00:02:50,650
So the result that said text resolved right.

50
00:02:50,820 --> 00:02:54,320
So now let's actually on our project and see what happens.

51
00:02:54,690 --> 00:02:57,890
So as you can see here our application is running on the simulator.

52
00:02:57,900 --> 00:03:05,070
So now if we actually passed the value 97 for example here ninety seven and then click on the spot and

53
00:03:05,070 --> 00:03:06,060
show me the result.

54
00:03:06,120 --> 00:03:09,480
It says your grade is a n and your number is 97 right.

55
00:03:09,480 --> 00:03:15,960
So here it is actually executing these statements because this expression evaluates to true the value

56
00:03:15,960 --> 00:03:18,840
of this interval is actually greater than 90 right.

57
00:03:18,870 --> 00:03:19,870
97.

58
00:03:20,080 --> 00:03:21,210
And now let's actually the.

59
00:03:21,240 --> 00:03:23,400
For example another value for example.

60
00:03:23,400 --> 00:03:25,000
Eighty four.

61
00:03:25,600 --> 00:03:27,060
And show me the result.

62
00:03:27,060 --> 00:03:30,440
Now it says your grade is B and your number is 84.

63
00:03:30,900 --> 00:03:33,130
And here is actually again.

64
00:03:33,150 --> 00:03:39,000
Is it this else if statement in value is greater than 70 so let's actually pass a value for example

65
00:03:39,000 --> 00:03:42,890
that is greater than 70 for example 71.

66
00:03:43,260 --> 00:03:44,160
Show me the result.

67
00:03:44,160 --> 00:03:47,750
Now it says your grade is c and your number is 71.

68
00:03:48,000 --> 00:03:51,630
And notice that if it actually passed the value for example 70 here.

69
00:03:51,660 --> 00:03:56,640
Now if I click on this button it says your grade is F and your number is 70.

70
00:03:56,730 --> 00:04:00,230
As you can see here now is going to actually execute this out.

71
00:04:00,310 --> 00:04:02,640
This actually is at this LCF statement.

72
00:04:02,640 --> 00:04:04,730
Its value is greater than 60.

73
00:04:05,040 --> 00:04:08,430
So here as you can see it when I actually created this LCF statement.

74
00:04:08,460 --> 00:04:14,180
I said that if the value of this into value is greater than 17 not equal to 70.

75
00:04:14,250 --> 00:04:20,160
So when we passed the value 70 here is going to execute this LCF statement that actually controls the

76
00:04:20,190 --> 00:04:24,570
values that are actually greater than 60 70 is greater than 60.

77
00:04:24,660 --> 00:04:31,170
So it is that right so that's how I actually decided to actually control these conditions.

78
00:04:31,170 --> 00:04:37,260
If I want to if you wanted to actually check for the seventy two I could put an assignment operator

79
00:04:37,260 --> 00:04:37,800
here.

80
00:04:37,920 --> 00:04:43,360
I could put this actually equal operator so greater than it greater than or equal to 70.

81
00:04:43,470 --> 00:04:49,160
Then it's going to if I pass the value 70 is going to give us the value c for the great.

82
00:04:49,280 --> 00:04:55,670
So that's how you manage your quotes so else if its value is greater than say 60 is going to execute

83
00:04:55,670 --> 00:04:57,740
this line of code here and else.

84
00:04:57,860 --> 00:05:04,850
So we created this Else statement here in order to actually control the conditions that are not actually

85
00:05:04,850 --> 00:05:05,780
specified here.

86
00:05:05,780 --> 00:05:10,700
So for example if none of the conditions above is true then it's going to execute this statement and

87
00:05:10,700 --> 00:05:13,430
it's going to actually show the result to the user.

88
00:05:13,460 --> 00:05:14,420
You are not accepted.

89
00:05:14,420 --> 00:05:20,000
So now let's actually pass the value for example number 50 and then click on the show me the result.

90
00:05:20,000 --> 00:05:27,820
Now it says you are not accepted because of you actually didn't control the values that are actually.

91
00:05:27,950 --> 00:05:32,990
For example a greater than 50 or equal to 50 right.

92
00:05:33,260 --> 00:05:38,060
So hopefully that makes sense and he and as he can see you can see that we are setting this result to

93
00:05:38,060 --> 00:05:40,800
these dx results so this is the X that is off right.

94
00:05:41,120 --> 00:05:43,880
So now let's actually pass another value.

95
00:05:43,880 --> 00:05:50,030
For example let's actually pass our lead here for example a here and now let's click on the spot in

96
00:05:50,030 --> 00:05:50,320
here.

97
00:05:50,320 --> 00:05:51,520
Show me the result.

98
00:05:51,890 --> 00:05:54,710
And now as you can see here our application crashed.

99
00:05:54,710 --> 00:05:55,250
Why.

100
00:05:55,370 --> 00:05:59,680
Because here as you can see if you look at this line of code here.

101
00:05:59,690 --> 00:06:06,590
When I actually been able to actually convert the value of these textfield value to an integer value

102
00:06:06,590 --> 00:06:11,900
as you can see here the value that is assigned for these takes with value must be actually of number

103
00:06:11,990 --> 00:06:12,630
right.

104
00:06:12,710 --> 00:06:18,700
If this value is actually a letter and when you want to actually convert that letter to an integer value.

105
00:06:18,810 --> 00:06:22,990
This method here is going to fail and then it's going to actually crash.

106
00:06:23,000 --> 00:06:28,920
So in order to avoid these kinds of crash Vini to actually provide exception handling here right.

107
00:06:28,950 --> 00:06:32,450
We need to handle the exceptions right.

108
00:06:32,720 --> 00:06:39,080
So I'll talk more about exception handling later in this course but for now remember that because you

109
00:06:39,080 --> 00:06:45,460
actually specified that view that this text textfield value is going to be an integer number.

110
00:06:45,690 --> 00:06:51,120
OK we need to actually passing an integer number into that textfield here.

111
00:06:51,150 --> 00:06:51,480
OK

112
00:06:56,310 --> 00:07:03,540
so as you can see here in this textfield here we must actually passing an integer number OK because

113
00:07:03,570 --> 00:07:12,180
we actually explicitly are determined that we are going to actually putting a value of type integer.

114
00:07:12,270 --> 00:07:19,680
OK we converted this value this textfield value to an integer number and we assign that value to this

115
00:07:19,680 --> 00:07:20,880
into value.

116
00:07:20,910 --> 00:07:23,790
And here we are actually working on this into you here.

117
00:07:23,880 --> 00:07:24,640
OK.

118
00:07:25,020 --> 00:07:26,640
So hopefully this makes sense.

119
00:07:26,640 --> 00:07:33,150
And if you have any questions please post the discussion in the calls and I'll do my best to answer

120
00:07:33,150 --> 00:07:34,020
your questions.

121
00:07:34,120 --> 00:07:39,150
And thank you very much for watching and I'll see you in the next tutorial.

