Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,600 --> 00:00:06,720
So let's start with our solution to find if this year is leep or not.
2
00:00:07,230 --> 00:00:12,630
So first of all, let's create additional variable, a new variable and call this variable year.
3
00:00:13,200 --> 00:00:15,120
Now, let's bring a nice message.
4
00:00:15,120 --> 00:00:17,080
Print out after a year.
5
00:00:17,130 --> 00:00:23,880
OK, so that the user will be able to specify what year he wants to check.
6
00:00:24,120 --> 00:00:29,550
Then we are going to use this kind of function and to read this information and store it inside the
7
00:00:29,550 --> 00:00:30,690
variable year.
8
00:00:31,530 --> 00:00:39,720
Now, what we are going to do is simply to take our previous conditions that we talked about and try
9
00:00:39,720 --> 00:00:40,970
to simplify them.
10
00:00:41,910 --> 00:00:49,290
So the first condition, I will even start from the end and I will say that we will check if year can
11
00:00:49,290 --> 00:00:51,140
be divided by 400.
12
00:00:51,390 --> 00:00:56,310
OK, without a remainder, we can simply write equal to zero.
13
00:00:56,730 --> 00:01:03,480
Then in this case, we can definitely say that the year is divided, can be divided by 400 without a
14
00:01:03,480 --> 00:01:06,690
remainder and also by four without a remainder.
15
00:01:06,690 --> 00:01:08,880
Write because 404, you know that.
16
00:01:09,630 --> 00:01:15,180
And even if it's even we know that it can be divided by 100.
17
00:01:15,570 --> 00:01:21,520
But still, if we know that it can be divided by 400, then that's a leap year.
18
00:01:21,540 --> 00:01:23,790
OK, just a couple of terminologies, guys.
19
00:01:24,060 --> 00:01:25,140
Nothing complicated.
20
00:01:25,140 --> 00:01:29,250
That's the rules to decide if a given year is leap or not.
21
00:01:29,520 --> 00:01:30,780
Nothing we can do about it.
22
00:01:31,080 --> 00:01:41,310
So in this case, let's simply print this year or maybe percentage the year, for example, of two thousand
23
00:01:41,310 --> 00:01:45,120
and whatever is a leap year.
24
00:01:45,280 --> 00:01:49,470
OK, so that's the first message that we are going to use.
25
00:01:49,490 --> 00:01:52,980
Backslash and of course and here we are going to print here.
26
00:01:53,730 --> 00:01:59,220
OK, so we are good with years that can be divided by 400 without the remainder.
27
00:01:59,970 --> 00:02:06,200
Now let's move on to if, for example, the result of this condition is false.
28
00:02:06,460 --> 00:02:10,610
OK, and that means that the year cannot be divided by 400.
29
00:02:11,400 --> 00:02:17,910
So in this case, we can say else if a year can be divided by a hundred without a remainder.
30
00:02:17,940 --> 00:02:18,290
Right.
31
00:02:18,300 --> 00:02:25,260
If we take a look at our explanation and it was the second condition that I showed you in the presentation,
32
00:02:25,620 --> 00:02:33,120
then in this case, we can say that this year is definitely is definitely not the leap year, because
33
00:02:33,120 --> 00:02:41,040
even if it can be divided by four without a remainder, but it still cannot be divided by 400, then
34
00:02:41,040 --> 00:02:43,030
definitely this year is not leap.
35
00:02:43,050 --> 00:02:45,720
So percentage percentage.
36
00:02:45,720 --> 00:02:49,560
The year is not a leap year.
37
00:02:49,920 --> 00:02:53,040
OK, here is specifically the year itself.
38
00:02:53,040 --> 00:02:54,020
And there you go.
39
00:02:54,030 --> 00:02:55,170
It's just correct.
40
00:02:55,280 --> 00:02:56,510
These are awesome.
41
00:02:57,270 --> 00:03:04,440
And now all that remains is basically to say that if the year cannot be divided by 400 without a remainder
42
00:03:04,440 --> 00:03:10,890
and also not by a hundred, then in this case what we have to do is simply to ask the following question.
43
00:03:10,890 --> 00:03:18,360
Else, if a year can be divided by four without the remainder, and if that's the case, then we are
44
00:03:18,360 --> 00:03:24,000
going to print that the year is a leap, year is a leap year.
45
00:03:24,960 --> 00:03:25,270
OK.
46
00:03:26,040 --> 00:03:32,100
So basically these are just the rules defined for a leap years.
47
00:03:32,580 --> 00:03:38,270
And one thing that we also need to take into account is what is the final Ale's?
48
00:03:38,280 --> 00:03:44,050
So if, for example, the result for this condition is falls and four releases falls and releases falls.
49
00:03:44,970 --> 00:03:54,810
So finally the last ls that takes the result of the remaining options will say that there are the lead.
50
00:03:55,110 --> 00:04:01,710
The year is not a leap of course, because it cannot be divided by four and absolutely that's not a
51
00:04:01,710 --> 00:04:02,570
leap year.
52
00:04:03,150 --> 00:04:05,120
So I hope that's clear to you guys.
53
00:04:05,130 --> 00:04:08,530
So we're forgot to return to zero at the end, just the specified.
54
00:04:09,420 --> 00:04:10,470
So I hope that's clear.
55
00:04:10,500 --> 00:04:13,830
That's how you find basically if a given year is leap or not.
56
00:04:14,320 --> 00:04:16,740
And yeah, I think this is it.
57
00:04:17,640 --> 00:04:24,140
Just remember that there are a couple of rules that you need to to check a couple of conditions.
58
00:04:24,360 --> 00:04:32,430
That's not something that you like, you know, like know it and apply it on a daily basis, probably.
59
00:04:32,700 --> 00:04:38,820
But since you know that you have to write some program and these programs should find if a year is leep
60
00:04:38,820 --> 00:04:39,300
or not.
61
00:04:39,310 --> 00:04:45,330
So your steps are, first of all to understand, OK, I'm going to write a program then to understand
62
00:04:45,450 --> 00:04:51,600
what are the conditions for a year to believe or not in like general terminology is just like you've
63
00:04:51,600 --> 00:04:57,990
seen in the presentation, and then simply to take these knowledged liked process it in your head and
64
00:04:58,680 --> 00:04:59,640
once you are done.
65
00:05:00,030 --> 00:05:07,160
Processing it simply will take this information and try to construct it in our programming language,
66
00:05:07,170 --> 00:05:10,970
in this case, it's the C programming language.
67
00:05:11,460 --> 00:05:14,560
So I guess, yeah, this is it for this video, guys.
68
00:05:14,580 --> 00:05:15,860
Thank you so much for watching.
69
00:05:15,870 --> 00:05:19,770
Keep on practicing and I will see you in the next video for us.
70
00:05:19,780 --> 00:05:26,100
If you have any questions, feel free to ask them and we will do our best to assist you with whatever
71
00:05:26,100 --> 00:05:26,470
you got.
72
00:05:26,880 --> 00:05:28,220
So until next time.
73
00:05:28,380 --> 00:05:29,250
My name is Ludde.
74
00:05:29,380 --> 00:05:30,150
I'll see you then.
7188
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.