Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:01,170 --> 00:00:01,700
OK.
2
00:00:01,740 --> 00:00:05,160
Ladies and gentlemen, so in this exercise, what we are going to do.
3
00:00:06,230 --> 00:00:08,590
He's simply create an array.
4
00:00:08,800 --> 00:00:12,380
Okay, and let's create an array of size, I don't know.
5
00:00:12,410 --> 00:00:12,920
10.
6
00:00:13,610 --> 00:00:20,570
And Lisa Ray will represent something related to your workout routine.
7
00:00:20,930 --> 00:00:26,210
So let's say you have created a an array of push ups or pull ups, whatever it is.
8
00:00:26,210 --> 00:00:27,710
So let's call it pull ups.
9
00:00:28,890 --> 00:00:37,230
Iraq and we will create a pull-ups array of size 10, and it will basically used to represent and to
10
00:00:37,230 --> 00:00:44,040
store the number of ups we did on the first day, on the second day, on the third day on the 4th and
11
00:00:44,040 --> 00:00:45,000
so on and so forth.
12
00:00:45,840 --> 00:00:50,970
So for example, on the first day we did, I don't know, the three pull-ups.
13
00:00:52,120 --> 00:00:57,910
And then on the next day, we did four on the third day, we need again, three because we were kind
14
00:00:57,910 --> 00:01:02,390
of tired, then we improved to five and then seven eight.
15
00:01:02,740 --> 00:01:05,490
And finally, we reached six nine.
16
00:01:05,500 --> 00:01:08,230
Let's go with nine once again.
17
00:01:08,230 --> 00:01:11,380
So we have like three, six nine.
18
00:01:11,380 --> 00:01:17,110
And finally, at the last day we reached it and not hundred, but to 10 pull.
19
00:01:17,740 --> 00:01:23,170
OK, so some working routine that you have created and every day you wrote down.
20
00:01:24,680 --> 00:01:28,270
The number of pull ups that you've done on these particular day.
21
00:01:29,000 --> 00:01:30,260
All right, so far, so good.
22
00:01:30,770 --> 00:01:31,650
Nothing complicated.
23
00:01:31,670 --> 00:01:39,830
I'm just trying to make this exercise kind of associated to something practical from all scenarios of
24
00:01:39,830 --> 00:01:40,640
working out.
25
00:01:41,120 --> 00:01:43,910
It could be pull ups, push ups, whatever it is.
26
00:01:43,910 --> 00:01:45,680
What's or something like that?
27
00:01:46,700 --> 00:01:50,870
OK, so now what we need to do is basically our program.
28
00:01:50,870 --> 00:01:58,670
We will write it to display this array, this array of values in a reverse order.
29
00:01:58,820 --> 00:02:04,670
OK, so we will print, for example, the number of pull ups we have done today.
30
00:02:04,940 --> 00:02:10,760
Yesterday, two days ago, three days ago, four days ago and so on and so forth five, six, seven,
31
00:02:10,760 --> 00:02:12,950
eight and nine days ago, right?
32
00:02:12,950 --> 00:02:16,250
Because we have 10 days, 10 days starting from today.
33
00:02:16,940 --> 00:02:21,860
So for that, what we will need is basically we know that we are going to use a for loop.
34
00:02:22,490 --> 00:02:22,880
OK.
35
00:02:23,120 --> 00:02:29,900
Because otherwise it won't make sense to write down print f pools or pull up, erase it index nine,
36
00:02:29,900 --> 00:02:31,280
eight, seven and so on.
37
00:02:32,450 --> 00:02:38,540
So since we know how to print array, we will need now to start the index not from a equals to zero,
38
00:02:38,540 --> 00:02:40,580
but rather what do you think?
39
00:02:40,580 --> 00:02:42,380
What should be the AI index?
40
00:02:43,040 --> 00:02:44,450
Think about it for a second.
41
00:02:46,180 --> 00:02:53,140
I should be equal to nine, right, because we have 10 elements and we know that the right most element
42
00:02:53,380 --> 00:02:55,390
starts from index nine.
43
00:02:56,290 --> 00:03:06,700
And we will run this loop until what condition until I is want, for example, greater or equal to zero.
44
00:03:07,300 --> 00:03:15,460
So as long as I is greater or equal to zero, we will go inside of these for loop buddy.
45
00:03:16,270 --> 00:03:23,170
And on every iteration, we will do a minus minus two degree meant the value of I by one.
46
00:03:24,400 --> 00:03:31,270
So once again, what we want to do here is basically to iterate over all of these array of pull ups
47
00:03:31,750 --> 00:03:39,910
and print the number of pull ups we have done starting from today up until 10 days ago or nine days
48
00:03:39,910 --> 00:03:40,810
ago in this case.
49
00:03:41,920 --> 00:03:47,070
So that's why we need to specify this index should start from nine.
50
00:03:47,110 --> 00:03:55,720
So in this case, we would do print f number of pull ups equals two percentage D.
51
00:03:56,850 --> 00:04:02,970
And then we will print pull up sarray pull ups and array at Index I.
52
00:04:05,130 --> 00:04:09,930
All right, is it clear now let's run this program and see what happens?
53
00:04:10,620 --> 00:04:11,840
So there you go.
54
00:04:11,850 --> 00:04:16,590
You can see number of pull ups equals to 10, number of bill of six or two, nine and so on and so forth.
55
00:04:17,970 --> 00:04:20,880
OK, so that's one option to solve this exercise.
56
00:04:21,370 --> 00:04:27,390
Another option, basically, instead of initializing it, we could have created this array and we could
57
00:04:27,390 --> 00:04:33,870
have said, OK, so let's ask the user, OK, let's do another for a loop starting from equals to zero
58
00:04:33,870 --> 00:04:40,020
ice less than 10 I + + and ask the user to something like that.
59
00:04:40,590 --> 00:04:41,130
High.
60
00:04:42,170 --> 00:04:43,970
Or let's go like this.
61
00:04:44,230 --> 00:04:46,790
Enter number of pull ups.
62
00:04:48,080 --> 00:04:49,280
On day.
63
00:04:50,570 --> 00:04:51,490
Percentage the.
64
00:04:52,590 --> 00:04:52,950
Right.
65
00:04:53,460 --> 00:04:56,910
And in this case, instead of percentage, they will use I +1.
66
00:04:58,350 --> 00:05:04,200
OK, so it will be on day one, on day two and so on and so forth, and we will read these information
67
00:05:04,200 --> 00:05:11,910
and storied inside percentage rate using the percentage de placeholder pull ups are rate at index I.
68
00:05:12,270 --> 00:05:12,860
That's it.
69
00:05:13,770 --> 00:05:15,900
And then we'll print the information.
70
00:05:16,410 --> 00:05:22,860
I'm just practicing with you a little bit of all of this info, so we will be able to print number of
71
00:05:22,860 --> 00:05:26,190
pull-ups equals two, OK, and we'll say that.
72
00:05:28,960 --> 00:05:31,000
One day, let's see.
73
00:05:32,020 --> 00:05:34,500
Um, percentage D..
74
00:05:35,710 --> 00:05:36,820
Days ago.
75
00:05:39,350 --> 00:05:41,930
Days ago, you did.
76
00:05:44,480 --> 00:05:46,490
Percentage de pull-ups.
77
00:05:48,390 --> 00:05:48,840
OK.
78
00:05:50,020 --> 00:05:58,480
So here we will specify, I write or better, I say we will specify 10 minus say, is it correct?
79
00:05:59,230 --> 00:06:01,450
10 minus I minus what?
80
00:06:01,900 --> 00:06:02,620
Minus one.
81
00:06:02,800 --> 00:06:03,430
Exactly.
82
00:06:03,790 --> 00:06:08,440
So what we want to do is zero days ago, which means today you did.
83
00:06:09,660 --> 00:06:16,050
Some number of pull ups, if we will reach the next iteration, when we reach the next iteration, I
84
00:06:16,050 --> 00:06:17,160
will be equal to one.
85
00:06:17,850 --> 00:06:20,170
So we will print out Tim.
86
00:06:20,550 --> 00:06:23,850
I will be equal to eight 10 minus eight minus one.
87
00:06:23,850 --> 00:06:29,010
It will be once a one days ago you did percentage the pull ups and so on and so forth.
88
00:06:29,310 --> 00:06:31,020
So let me show you what it will look like.
89
00:06:31,950 --> 00:06:34,050
So we created this kind of program.
90
00:06:34,050 --> 00:06:36,900
Enter a number of pull ups on day one, let's say.
91
00:06:37,140 --> 00:06:37,740
What was it?
92
00:06:37,920 --> 00:06:46,870
I don't remember five three one two nine six five five four three and let's go seven.
93
00:06:46,890 --> 00:06:47,880
And finally, Tim.
94
00:06:49,100 --> 00:06:55,910
So now what we can see that zero days ago, which means today you need 10 pull ups, one days ago you
95
00:06:55,910 --> 00:06:57,080
did seven pull ups.
96
00:06:57,260 --> 00:07:03,620
It is the index of the Ninth Element in disarray and so on and so forth.
97
00:07:03,890 --> 00:07:12,200
So you were able in this exercise to what you were able to print were a display.
98
00:07:13,390 --> 00:07:16,180
Display the array.
99
00:07:17,850 --> 00:07:23,010
Values in a reverse order.
100
00:07:24,550 --> 00:07:25,240
Is it clear?
101
00:07:26,600 --> 00:07:30,560
If you have any questions, feel free to ask, my name is Vlad Lisas, Alfa Tech.
102
00:07:30,950 --> 00:07:32,210
Thank you so much for watching.
103
00:07:32,240 --> 00:07:33,500
Keep on practicing.
104
00:07:33,800 --> 00:07:37,460
Keep on moving forward and you are bound to succeed.
105
00:07:37,910 --> 00:07:38,720
I'll see you next time.
9400
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.