1
00:00:03,150 --> 00:00:05,160
Hello, guys, and welcome back to the calls.

2
00:00:05,640 --> 00:00:08,800
In the last lesson, we covered three problems off part one.

3
00:00:09,150 --> 00:00:11,850
So to really be solving three problems of part two.

4
00:00:16,060 --> 00:00:17,050
So problem one.

5
00:00:20,820 --> 00:00:22,230
So the president's statement is.

6
00:00:23,540 --> 00:00:24,740
Read in numbers.

7
00:00:28,480 --> 00:00:33,370
And bringing to their average Brent, their average.

8
00:00:35,040 --> 00:00:39,930
So if you remember, we have already covered the simple version of this problem.

9
00:00:40,440 --> 00:00:45,690
The problem statement was we have to read five numbers and we have to print their average.

10
00:00:46,230 --> 00:00:48,330
And the flowchart was something like this.

11
00:00:48,900 --> 00:00:57,600
We start our program and then we read five numbers, read A, B, C, D and E.

12
00:00:58,900 --> 00:01:07,090
These are five numbers, and then I have to calculate some, which is summation of all these numbers.

13
00:01:09,620 --> 00:01:15,660
And then I have to conclude my average, which is equals to some by five.

14
00:01:17,300 --> 00:01:17,960
And then.

15
00:01:19,660 --> 00:01:20,780
I will print average.

16
00:01:21,760 --> 00:01:23,990
After printing average, my work is over.

17
00:01:24,370 --> 00:01:26,380
And then I will end my program.

18
00:01:28,360 --> 00:01:33,400
So this is the simpler version of this problem that we have already covered.

19
00:01:33,820 --> 00:01:37,690
So what is the difference between this problem and this problem?

20
00:01:38,320 --> 00:01:41,530
So the defense is very clear in this problem.

21
00:01:41,740 --> 00:01:47,110
I already know that I have to read five numbers, so I make five variables.

22
00:01:47,170 --> 00:01:48,290
ABC d e.

23
00:01:48,850 --> 00:01:50,260
But then this problem.

24
00:01:50,410 --> 00:01:51,400
I don't know.

25
00:01:51,490 --> 00:01:53,350
How many variables do I have to make?

26
00:01:53,800 --> 00:01:57,820
I don't know the value of and value of and will be given by user.

27
00:01:58,360 --> 00:02:01,660
So I don't know how many variables do I have to make.

28
00:02:02,350 --> 00:02:06,130
So our first problem is to how to read and numbers.

29
00:02:07,850 --> 00:02:10,940
How do read and numbers?

30
00:02:12,030 --> 00:02:15,450
So this is our first problem, how to read and numbers.

31
00:02:16,200 --> 00:02:17,190
So what will I do?

32
00:02:17,730 --> 00:02:20,460
I will run a loop and times.

33
00:02:23,250 --> 00:02:29,730
I will run a loop and times and each time I will read no, read no.

34
00:02:31,080 --> 00:02:36,370
So in total, this loop is learning and times and each time I am reading a number.

35
00:02:36,730 --> 00:02:39,130
So in total I will be reading in numbers.

36
00:02:41,850 --> 00:02:44,940
So our first problem is a lot of reading and numbers.

37
00:02:45,210 --> 00:02:47,700
OK, so how we learn loop and times.

38
00:02:49,200 --> 00:02:50,460
So the answer is very simple.

39
00:02:50,520 --> 00:02:52,230
I will use these two condition.

40
00:02:52,830 --> 00:02:56,190
I was one I less than or equal to N.

41
00:02:57,900 --> 00:02:59,820
And I it was a plus one.

42
00:03:00,450 --> 00:03:07,230
So using these three blogs, I will be able to run a loop and times and each time I will do that number.

43
00:03:07,710 --> 00:03:11,220
So in total, I will be able to read and numbers.

44
00:03:13,290 --> 00:03:16,260
So the first problem is, oh, we're operating in numbers.

45
00:03:16,380 --> 00:03:19,280
Now, the second problem I have to calculate average.

46
00:03:20,070 --> 00:03:24,060
So average equals to some of.

47
00:03:25,660 --> 00:03:27,840
All these numbers.

48
00:03:30,060 --> 00:03:31,050
Some of all this.

49
00:03:31,130 --> 00:03:33,840
And numbers, why did why?

50
00:03:33,910 --> 00:03:37,980
And so I know the really often which will be given by user.

51
00:03:38,370 --> 00:03:42,330
I have to convert this part some of all these numbers.

52
00:03:42,840 --> 00:03:43,650
So what will I do?

53
00:03:43,740 --> 00:03:45,040
I will use a variable sum.

54
00:03:45,690 --> 00:03:47,700
Initially, my son will be zero.

55
00:03:48,180 --> 00:03:52,410
And when I am reading my name, but I will add this number to the current sum.

56
00:03:52,860 --> 00:03:54,720
That is some equals.

57
00:03:54,960 --> 00:03:55,950
Some bliss number.

58
00:03:57,790 --> 00:03:58,210
So rude.

59
00:03:58,300 --> 00:04:01,170
No, at this number two, the current system.

60
00:04:01,750 --> 00:04:02,470
So when this loop.

61
00:04:02,500 --> 00:04:03,220
Wait a minute.

62
00:04:03,350 --> 00:04:07,230
That is after running and times in my variable sum.

63
00:04:07,600 --> 00:04:13,780
I will be having some of all these numbers and then I will easily calculate the value of average.

64
00:04:13,810 --> 00:04:15,130
And then I will point average.

65
00:04:15,630 --> 00:04:15,920
OK.

66
00:04:16,240 --> 00:04:17,950
So let's roll the flow chart.

67
00:04:21,350 --> 00:04:22,100
So start.

68
00:04:24,620 --> 00:04:26,750
And then I have duded and.

69
00:04:32,680 --> 00:04:39,220
And then I will take a variable eye, which is initialized to win because I want to add an eye loop

70
00:04:39,280 --> 00:04:43,240
and Pym's and my sum will be initially zero.

71
00:04:46,250 --> 00:04:50,990
Now we'll check the condition is I left the Noriko's to end.

72
00:04:52,280 --> 00:04:53,780
So if this condition is true.

73
00:04:56,040 --> 00:04:57,450
Now I'm inside the loop.

74
00:04:57,660 --> 00:04:58,290
What will I do?

75
00:04:58,380 --> 00:05:00,810
I will read no you the number.

76
00:05:05,410 --> 00:05:09,370
And after reading this number, I will add this number to my current sum.

77
00:05:10,000 --> 00:05:16,610
So the new value of some equals over the value of some, bless the number that I have read.

78
00:05:21,560 --> 00:05:26,960
I close, I listen because I want to run this loop and times.

79
00:05:27,500 --> 00:05:31,370
So this loop villain and times each time I am reading a number.

80
00:05:31,610 --> 00:05:35,150
And after reading that number, I'm adding this number to the current sum.

81
00:05:36,200 --> 00:05:38,630
So when this condition will become false.

82
00:05:45,000 --> 00:05:49,680
So my average will be some divided by and.

83
00:05:51,470 --> 00:05:59,430
Sam is storing some of all those numbers, and after calculating average, I will print average.

84
00:06:01,350 --> 00:06:02,640
Now my work is over.

85
00:06:03,030 --> 00:06:04,470
I will end my program.

86
00:06:06,140 --> 00:06:06,530
And.

87
00:06:16,870 --> 00:06:25,120
OK, so let us take an example, let's say the really off and is three and the numbers are one, two

88
00:06:25,240 --> 00:06:27,640
and three, so numbers are 120.

89
00:06:27,860 --> 00:06:29,930
And I'm having total TNM was.

90
00:06:30,320 --> 00:06:31,280
So what is the average?

91
00:06:32,260 --> 00:06:34,580
One plus two plus three.

92
00:06:34,920 --> 00:06:37,640
All elevated wady letters to.

93
00:06:38,810 --> 00:06:41,400
Okay, so I started my program.

94
00:06:41,950 --> 00:06:46,240
I read in an enclosed tree, I close one semigloss zero.

95
00:06:46,880 --> 00:06:52,140
So I it was when some equals zero.

96
00:06:53,420 --> 00:06:54,920
And then I will come here.

97
00:06:57,160 --> 00:06:59,770
Is one less to know, note goes to three.

98
00:07:00,160 --> 00:07:00,670
Yes.

99
00:07:01,030 --> 00:07:01,570
Come here.

100
00:07:02,390 --> 00:07:03,160
Read a number.

101
00:07:03,670 --> 00:07:04,600
OK, read one.

102
00:07:07,120 --> 00:07:08,650
Add this number to the current sum.

103
00:07:09,550 --> 00:07:13,330
So sum, it was zero plus one that this one.

104
00:07:14,500 --> 00:07:14,860
OK.

105
00:07:16,980 --> 00:07:18,240
I equals I plus one.

106
00:07:18,270 --> 00:07:19,740
So the new radio fi is.

107
00:07:21,160 --> 00:07:21,970
All vilify.

108
00:07:22,440 --> 00:07:24,730
Which is one plus one that this, too.

109
00:07:25,530 --> 00:07:28,860
So new if I is to and then you have to come here.

110
00:07:30,940 --> 00:07:32,810
Is to list the Noriko's two three.

111
00:07:32,860 --> 00:07:34,840
So the condition is again through, you will come here?

112
00:07:35,590 --> 00:07:36,000
No.

113
00:07:36,580 --> 00:07:38,590
This time I will do so.

114
00:07:38,830 --> 00:07:42,870
The new valy of some will be all will leave some place.

115
00:07:43,060 --> 00:07:44,370
That number that you have read.

116
00:07:45,460 --> 00:07:46,810
One to two.

117
00:07:47,220 --> 00:07:47,680
Destry.

118
00:07:48,510 --> 00:07:48,740
OK.

119
00:07:48,820 --> 00:07:52,140
Now you will come here and given really if I buy one.

120
00:07:52,750 --> 00:07:55,390
So the new value of fi will be two plus one.

121
00:07:55,440 --> 00:07:56,260
That is three.

122
00:07:57,860 --> 00:08:02,040
Jack Deconditioned again is three, Lester goes to three.

123
00:08:02,480 --> 00:08:04,670
So the condition is again through, you will again come here.

124
00:08:05,960 --> 00:08:06,230
Greed.

125
00:08:06,450 --> 00:08:08,220
Number three.

126
00:08:09,000 --> 00:08:09,960
Some equals.

127
00:08:11,160 --> 00:08:13,640
All three of them, plus the number that you have read.

128
00:08:14,250 --> 00:08:16,450
So three plus three letters.

129
00:08:16,830 --> 00:08:19,260
Six in commander commendably if I buy one.

130
00:08:19,620 --> 00:08:23,010
So the new vilify is always lo fi.

131
00:08:24,140 --> 00:08:27,010
Which is three plus one at this food.

132
00:08:27,820 --> 00:08:28,930
Check the condition again.

133
00:08:30,640 --> 00:08:35,050
As for less tornadoes, two, three, no, so a condition is false.

134
00:08:35,680 --> 00:08:38,210
And this loop will break again.

135
00:08:38,410 --> 00:08:45,320
So average equals some, which is close to six divided by N and is three.

136
00:08:46,030 --> 00:08:47,790
So my averages do.

137
00:08:48,490 --> 00:08:50,050
And then you will bring to an average.

138
00:08:51,690 --> 00:08:52,830
So, too, will be printed.

139
00:08:53,100 --> 00:08:59,670
And you will endure program so for this do, which is hundred percent correct.

140
00:09:00,390 --> 00:09:01,410
Okay, so.

141
00:09:07,160 --> 00:09:13,670
Let us revise what we have done, so I have to read in numbers, and I would do bring average.

142
00:09:14,540 --> 00:09:18,920
We have already done a simple evasion of this problem and that problem.

143
00:09:18,980 --> 00:09:23,450
I have read this five numbers and I have to bring the average of those five numbers.

144
00:09:23,780 --> 00:09:28,160
So what I did, I tried my program, I read five numbers.

145
00:09:28,250 --> 00:09:29,420
I make five variables.

146
00:09:29,750 --> 00:09:32,570
And I take the values of those five numbers.

147
00:09:32,600 --> 00:09:33,800
Then I concluded some.

148
00:09:34,160 --> 00:09:37,220
Then I concluded average print average and end my program.

149
00:09:37,790 --> 00:09:42,290
But the first problem of discussion is how I will read in them was.

150
00:09:43,710 --> 00:09:49,920
I can't make any variables because I don't know the value of an the value of and we beg you and my user.

151
00:09:50,490 --> 00:09:55,830
So this is very straightforward that I cannot make any variables because I don't know the value of an.

152
00:09:56,980 --> 00:09:58,930
So what we will do.

153
00:09:59,020 --> 00:10:03,400
We will run a loop and times is using these three blocks.

154
00:10:03,910 --> 00:10:08,620
I will be able to run my loop and times and each time I will read that number.

155
00:10:09,130 --> 00:10:11,890
So in total, I will be able to read and numbers.

156
00:10:12,910 --> 00:10:14,490
OK, so first problem is over.

157
00:10:15,340 --> 00:10:16,940
Now let's see that problem.

158
00:10:17,050 --> 00:10:18,190
I have to print that average.

159
00:10:19,810 --> 00:10:26,470
For calculating the average, I read some of these numbers for calculating some.

160
00:10:26,560 --> 00:10:28,870
What will I do when I am reading the number?

161
00:10:29,020 --> 00:10:31,060
I will add this number to the current sum.

162
00:10:33,160 --> 00:10:39,910
So the new value of some goes to or value of some plus the number that I have read.

163
00:10:42,250 --> 00:10:46,380
And then when this loop will terminate, when this loop.

164
00:10:46,470 --> 00:10:47,170
Wait a minute.

165
00:10:47,350 --> 00:10:50,110
That is after this loop at an end times.

166
00:10:50,560 --> 00:10:58,660
My variable sum will be storing the sum of all these numbers and then I will calculate my average using

167
00:10:58,660 --> 00:10:59,290
this formula.

168
00:10:59,910 --> 00:11:00,060
OK.

169
00:11:00,260 --> 00:11:00,640
So.

170
00:11:02,710 --> 00:11:04,080
Let's look at the flow chart.

171
00:11:04,320 --> 00:11:07,990
Okay, let's take another example, let's say any equals.

172
00:11:09,490 --> 00:11:11,040
Two, and then the Mossad.

173
00:11:12,490 --> 00:11:16,750
Four and six, so averages four plus six.

174
00:11:17,410 --> 00:11:18,670
By doing that, it's five.

175
00:11:19,240 --> 00:11:23,770
OK, so start with you then I equals one time it goes zero.

176
00:11:24,130 --> 00:11:25,570
So I equals one.

177
00:11:26,290 --> 00:11:28,090
Some equals zero.

178
00:11:28,540 --> 00:11:29,020
Come here.

179
00:11:30,640 --> 00:11:33,580
Is one less than already close to two.

180
00:11:33,850 --> 00:11:35,080
So the condition is true.

181
00:11:35,710 --> 00:11:36,130
Yes.

182
00:11:36,640 --> 00:11:37,090
Come here.

183
00:11:37,200 --> 00:11:37,410
Rude.

184
00:11:37,480 --> 00:11:42,180
No, I will read for them here at this number.

185
00:11:42,230 --> 00:11:42,940
The current sum.

186
00:11:44,440 --> 00:11:47,020
So some equals zero plus four letters, four.

187
00:11:47,560 --> 00:11:47,870
Okay.

188
00:11:48,370 --> 00:11:50,530
Come here and go under.

189
00:11:50,610 --> 00:11:58,060
If I, I went to the new Bailey, if I will be to check the condition again is to list Donna goes to

190
00:11:58,060 --> 00:11:59,770
do for the condition is true.

191
00:12:00,670 --> 00:12:01,090
Yes.

192
00:12:01,460 --> 00:12:01,730
No.

193
00:12:02,500 --> 00:12:04,230
This time I will read six.

194
00:12:05,200 --> 00:12:06,700
Add this number to the current sum.

195
00:12:07,540 --> 00:12:11,350
So sum equals four plus six.

196
00:12:11,440 --> 00:12:12,190
That is 10.

197
00:12:13,220 --> 00:12:14,800
And given the value if I buy one.

198
00:12:16,450 --> 00:12:16,930
So I.

199
00:12:16,930 --> 00:12:18,240
It goes to bless one.

200
00:12:18,340 --> 00:12:19,150
That is three.

201
00:12:20,050 --> 00:12:22,710
Check the condition again is three less.

202
00:12:22,780 --> 00:12:23,750
Then I go straight to.

203
00:12:26,080 --> 00:12:26,390
No.

204
00:12:26,540 --> 00:12:27,640
The condition is false.

205
00:12:27,670 --> 00:12:28,650
So you will come here.

206
00:12:30,080 --> 00:12:30,300
OK.

207
00:12:30,380 --> 00:12:37,370
Calculate the average average equals sum divided away and add the value of.

208
00:12:37,400 --> 00:12:38,540
And is to.

209
00:12:40,050 --> 00:12:43,800
So average equals five, then Brint average.

210
00:12:43,890 --> 00:12:48,100
OK, five for Lubricator and then endure program.

211
00:12:48,660 --> 00:12:53,220
So I am burning five and average of four and six is five.

212
00:12:53,790 --> 00:12:56,340
So I went flowcharts hundred percent.

213
00:12:56,550 --> 00:12:56,920
Correct.

214
00:12:57,950 --> 00:12:58,590
Like, that's all.

215
00:12:58,620 --> 00:12:59,340
And the problem.
