All language subtitles for 18. Find the next day on Calendar! - Solution

af Afrikaans
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bn Bengali
bs Bosnian
bg Bulgarian
ca Catalan
ceb Cebuano
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
tl Filipino
fi Finnish
fr French
fy Frisian
gl Galician
ka Georgian
de German
el Greek
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian Download
is Icelandic
ig Igbo
id Indonesian
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
km Khmer
ko Korean
ku Kurdish (Kurmanji)
ky Kyrgyz
lo Lao
la Latin
lv Latvian
lt Lithuanian
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mn Mongolian
my Myanmar (Burmese)
ne Nepali
no Norwegian
ps Pashto
fa Persian
pl Polish
pt Portuguese
pa Punjabi
ro Romanian
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
st Sesotho
sn Shona
sd Sindhi
si Sinhala
sk Slovak
sl Slovenian
so Somali
es Spanish
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
te Telugu
th Thai
tr Turkish
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu
or Odia (Oriya)
rw Kinyarwanda
tk Turkmen
tt Tatar
ug Uyghur
Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated: 1 00:00:00,930 --> 00:00:02,910 OK, welcome back. 2 00:00:03,090 --> 00:00:12,050 And in this solution, what we are going to do, what are we going to do is to find the next day, right? 3 00:00:12,420 --> 00:00:20,310 So we will need to get all the information for our current date, for example, the day, the month 4 00:00:20,310 --> 00:00:21,150 and the year. 5 00:00:21,660 --> 00:00:28,740 And right afterward, we should find the next day while taking into consideration all the things that 6 00:00:28,740 --> 00:00:30,370 we've specified before. 7 00:00:31,140 --> 00:00:37,860 For example, if we are at the last day of the month, if it's a leap year or not, and so on and so 8 00:00:37,860 --> 00:00:38,280 forth. 9 00:00:39,000 --> 00:00:44,490 So let's start by creating three variables in day, month and year. 10 00:00:44,610 --> 00:00:52,410 OK, so in day, month and year and also we'll specify and leap year equals do zero. 11 00:00:52,590 --> 00:00:59,770 OK, so day, month, year and leap year equals to zero, which is simple default. 12 00:00:59,790 --> 00:01:06,120 OK, that I will use for this video some default that says the leap the year is not leap. 13 00:01:06,130 --> 00:01:12,270 Otherwise if we will change it it will be like not zero will specify that it's a leap year. 14 00:01:12,300 --> 00:01:13,310 OK, for example. 15 00:01:13,920 --> 00:01:24,840 So let's just start getting all the information, enter the day or enter day and in this case enter 16 00:01:24,840 --> 00:01:25,920 the day. 17 00:01:26,250 --> 00:01:34,020 We will use it to read the day just kind of percentage and store it inside variable day. 18 00:01:34,350 --> 00:01:39,270 OK, and the same we are going to do also for the month, right. 19 00:01:39,290 --> 00:01:40,090 Oops. 20 00:01:40,110 --> 00:01:44,850 Sorry about the month and about the year. 21 00:01:44,940 --> 00:01:47,340 OK, so month and year. 22 00:01:47,640 --> 00:01:53,820 And one thing that I want to mention here in this video, guys, is that once again, you see that I 23 00:01:53,970 --> 00:01:56,280 don't use only presentations. 24 00:01:56,280 --> 00:02:00,810 I use like hands on with you guys to solve different exercises. 25 00:02:01,230 --> 00:02:03,900 And sometimes it take us a little bit more time. 26 00:02:03,900 --> 00:02:11,450 But I think this step by step tutorial that I go with you together is really it's really worth you, 27 00:02:11,460 --> 00:02:19,370 because from my experience, a lot of students prefer this way of teaching, and I hope that you, too. 28 00:02:20,200 --> 00:02:29,710 Anyway, let's get back to business and let's use here the end of month and the unberth percent of year. 29 00:02:29,730 --> 00:02:31,510 OK, awesome. 30 00:02:31,590 --> 00:02:35,310 So enter a day, enter month and enter year. 31 00:02:36,000 --> 00:02:37,740 And now what should we do? 32 00:02:38,160 --> 00:02:40,950 What should we basically do and why? 33 00:02:41,190 --> 00:02:44,340 What will be our next move? 34 00:02:45,150 --> 00:02:54,540 So what I suggest is simply to you, first of all, let's find out if a given year is leap or not, 35 00:02:54,690 --> 00:02:56,220 OK, or not. 36 00:02:57,540 --> 00:02:59,150 So how can we do it? 37 00:02:59,940 --> 00:03:02,910 We can simply use the following conditions that we had. 38 00:03:03,360 --> 00:03:12,930 But what I will do is simply to kind of to kind of let's see if we are interested in a leap year. 39 00:03:13,470 --> 00:03:20,760 The only thing that is going to interest us is if a given month is simply February. 40 00:03:20,760 --> 00:03:21,060 Right. 41 00:03:21,060 --> 00:03:24,650 Because otherwise we don't care if the year is leap or not. 42 00:03:25,470 --> 00:03:32,150 So let's say if month equals two, what is it is still right. 43 00:03:32,160 --> 00:03:46,080 Because if it's February, February, and also if the year is leap, so if let's say year MODULA, I 44 00:03:46,080 --> 00:03:51,560 just want to summarize all of the conditions that we've used in the previous video to one condition. 45 00:03:51,570 --> 00:03:59,670 So if you're it can be divided by four without a remainder and also the year can be divided by a hundred, 46 00:03:59,730 --> 00:04:08,550 OK, with some remainder or basically the year cannot be divided by hundred without a remainder or the 47 00:04:08,550 --> 00:04:14,220 year it can be divided by a hundred four hundred without the remainder. 48 00:04:14,260 --> 00:04:22,950 OK, so that's just the formal conditions that we've used in our previous in our previous video. 49 00:04:22,970 --> 00:04:25,110 So let's just make sure that everything was OK. 50 00:04:25,110 --> 00:04:32,430 So a year divided by four without the remainder and also and also OK. 51 00:04:32,430 --> 00:04:41,510 And also either the year cannot be divided by a hundred year or a year can be divided by 400. 52 00:04:42,300 --> 00:04:51,420 So OK, so if it can be divided by four without the remainder and also either of these condition seems 53 00:04:51,420 --> 00:04:52,000 to be true. 54 00:04:52,020 --> 00:04:56,760 So hopefully guys, make sure that you check out this condition. 55 00:04:56,760 --> 00:05:00,300 If I have done it for 100 percent, OK, because. 56 00:05:00,390 --> 00:05:07,530 This exercise is not all about it, but still, anyway, just make sure you check me out, maybe you 57 00:05:07,530 --> 00:05:09,290 have some small mistake here. 58 00:05:09,300 --> 00:05:10,350 I'm not sure about it. 59 00:05:10,800 --> 00:05:16,620 So if if so, I will, of course, update the content in some description below. 60 00:05:17,490 --> 00:05:21,390 But until then, let's simply proceed so we are equals to one. 61 00:05:21,390 --> 00:05:25,400 And that means that the year is what is it? 62 00:05:25,410 --> 00:05:27,900 It's like, OK, so awesome. 63 00:05:28,110 --> 00:05:33,660 So now all that remains to do is simply to move one day further. 64 00:05:33,660 --> 00:05:36,590 So day plus equals to one. 65 00:05:36,600 --> 00:05:40,650 So we simply use day equals to the previous day plus one. 66 00:05:41,430 --> 00:05:42,110 OK. 67 00:05:43,410 --> 00:05:43,800 Whoo! 68 00:05:43,980 --> 00:05:52,050 So now we need to take into consideration a lot of options and these options basically are based on 69 00:05:52,050 --> 00:05:52,770 the month. 70 00:05:52,770 --> 00:05:53,130 Right. 71 00:05:53,130 --> 00:06:01,260 We previously used some exercise with months just to get the number of the month into print, the name 72 00:06:01,260 --> 00:06:04,800 of the month and we used switch case option. 73 00:06:04,800 --> 00:06:08,010 So probably here it will be also a good idea. 74 00:06:08,790 --> 00:06:17,400 Let's use switch case switch case on month, OK, and switch case on month because we know there may 75 00:06:17,400 --> 00:06:22,610 be months with a lot of different on days. 76 00:06:22,620 --> 00:06:28,950 So we know that if we are going to use for example, the first month. 77 00:06:29,160 --> 00:06:29,580 Right. 78 00:06:29,590 --> 00:06:38,040 So it's case one, it's January, it may be case three, which is marriage case five. 79 00:06:38,430 --> 00:06:44,130 And that's basically, guys, some information that I'm taking from the calendar and I can see which 80 00:06:44,130 --> 00:06:51,840 days have, you know, like thirty one days in which days, which months have 30 days and we each have 81 00:06:51,840 --> 00:06:52,550 thirty one. 82 00:06:53,100 --> 00:06:55,650 So it will be case seven. 83 00:06:55,780 --> 00:06:57,990 OK, I'm not inventing here anything. 84 00:06:57,990 --> 00:07:00,780 OK, so I'm simply writing the conditions. 85 00:07:00,900 --> 00:07:07,110 So case 10 and case is December Yuki's December. 86 00:07:07,110 --> 00:07:08,330 So case twelve. 87 00:07:09,060 --> 00:07:16,080 So if month equals to one or month equals to three or month equals to five and so on. 88 00:07:16,380 --> 00:07:23,910 If that's the case we will check if day after it was incremented is less or equal to thirty one. 89 00:07:24,210 --> 00:07:26,180 And if that's the case that's OK. 90 00:07:26,310 --> 00:07:30,840 That means we do not have to move one month further. 91 00:07:30,900 --> 00:07:32,070 OK, so break. 92 00:07:32,520 --> 00:07:38,900 And in this case we know that that's that, that's OK. 93 00:07:39,780 --> 00:07:40,410 Awesome. 94 00:07:41,130 --> 00:07:43,290 So we know it's about these days. 95 00:07:43,560 --> 00:07:47,160 And also let's check now about the other months. 96 00:07:47,370 --> 00:07:56,190 So it will be like what was it case for case six, which is June oh, case nine. 97 00:07:56,190 --> 00:07:58,620 I think it's September case. 98 00:07:59,850 --> 00:08:00,630 What was it. 99 00:08:00,630 --> 00:08:03,870 Case eleven November and yeah, I think that's it. 100 00:08:03,870 --> 00:08:04,110 Right. 101 00:08:04,110 --> 00:08:06,300 We have one, two, three, four, five, six, seven. 102 00:08:06,360 --> 00:08:08,990 OK, six, seven and four. 103 00:08:09,000 --> 00:08:09,840 OK, exactly. 104 00:08:10,110 --> 00:08:15,130 So now let's check if day is less than or equal to thirty three. 105 00:08:15,200 --> 00:08:16,050 That's the case. 106 00:08:16,200 --> 00:08:17,340 It's also OK. 107 00:08:17,370 --> 00:08:25,100 Right, because we know that the next day you stealing range and we do not have to move month one further 108 00:08:25,100 --> 00:08:26,040 or so break. 109 00:08:26,550 --> 00:08:27,720 And that's also OK. 110 00:08:28,590 --> 00:08:35,640 And now let's read the last month, which is the most problematic. 111 00:08:35,640 --> 00:08:44,340 But the month with that relies on the fact that if we have leap year or not, leap year or so, case 112 00:08:44,340 --> 00:08:48,660 two, and if that's February, right. 113 00:08:48,660 --> 00:08:51,300 It's fair but fair. 114 00:08:51,300 --> 00:08:52,920 But rule three. 115 00:08:53,460 --> 00:08:57,000 And if that's the case, we should ask the following question. 116 00:08:57,180 --> 00:09:05,370 If the day is less than or equal to twenty nine, but it's a leap year. 117 00:09:05,370 --> 00:09:08,880 Let's say leap year equals one, then that's OK. 118 00:09:09,060 --> 00:09:09,720 That's OK. 119 00:09:10,350 --> 00:09:13,320 But if we know that it's not the leap year. 120 00:09:13,320 --> 00:09:15,460 OK, so let's do break ok. 121 00:09:15,900 --> 00:09:24,870 And else if else if and if we will say the day is less than or equal to twenty eight which is also OK 122 00:09:25,440 --> 00:09:26,940 we'll also use break. 123 00:09:27,040 --> 00:09:34,860 OK, so simply what we are doing in these switch cases is just to like to take into account all the 124 00:09:34,860 --> 00:09:44,370 necessary information for us to like to work with are the days to work with the days where we don't 125 00:09:44,370 --> 00:09:52,250 have to move month neither neither month nor a year one ahead, which are simply just to increment day 126 00:09:52,260 --> 00:09:54,120 by one and everything works correctly. 127 00:09:54,120 --> 00:09:55,650 So that's this one. 128 00:09:55,650 --> 00:09:56,790 And that's this one. 129 00:09:56,790 --> 00:09:57,900 And that's the case. 130 00:09:57,900 --> 00:09:59,850 OK, so if days less than. 131 00:10:00,510 --> 00:10:07,680 Less than or equal to 31 in either of these months or an equal LFS or less than 30 in these months and 132 00:10:07,680 --> 00:10:08,070 so on. 133 00:10:08,340 --> 00:10:09,030 So that's OK. 134 00:10:09,040 --> 00:10:15,510 But if this condition was false or this condition was false, again, it's very important to notice 135 00:10:15,510 --> 00:10:17,160 here how this case works. 136 00:10:17,560 --> 00:10:23,010 If this condition was false or in this condition was false or if this condition was false, either of 137 00:10:23,010 --> 00:10:29,820 them, OK, basically this condition was not executed or if this condition was not executed, then the 138 00:10:29,820 --> 00:10:36,720 break command that simply issued, like, you know, like to get you out of this, which case statement 139 00:10:37,020 --> 00:10:39,230 then it would not have been executed. 140 00:10:39,240 --> 00:10:46,830 So what are the part that will be executed is the default part and the default part goes like this. 141 00:10:47,040 --> 00:10:54,420 So we will say that the they should be equal to one, because if we move to the next month, the month 142 00:10:54,420 --> 00:10:57,600 should be equal to like the next month. 143 00:10:57,610 --> 00:11:04,860 So months equal to to the previous month plus one. 144 00:11:06,060 --> 00:11:10,160 It also will say that each month is greater than 12. 145 00:11:10,590 --> 00:11:11,250 OK, right. 146 00:11:11,250 --> 00:11:19,050 Because it can be like if we have like if we've been on December and we added just one, OK, then we've 147 00:11:19,050 --> 00:11:23,250 moved to the next month, which is like January. 148 00:11:23,280 --> 00:11:27,210 So it will be it should be a month equal to one. 149 00:11:27,360 --> 00:11:38,900 So this case will specify that month it was two one and also year added by one case. 150 00:11:38,910 --> 00:11:43,730 So year equal to the previous year plus one. 151 00:11:43,920 --> 00:11:45,150 That's how we should do it. 152 00:11:45,840 --> 00:11:50,990 And it's guys, it's super important to understand the structure here once again. 153 00:11:51,000 --> 00:11:53,490 So we are running over the months. 154 00:11:53,490 --> 00:11:58,470 We check if a given condition of each day is less than or equal to thirty one. 155 00:11:59,220 --> 00:12:03,330 If that's the case, we break and we get out of this switch case once and for all. 156 00:12:03,330 --> 00:12:04,860 But even that's not the case. 157 00:12:04,860 --> 00:12:07,470 Each day was like, I don't know, thirty two. 158 00:12:07,800 --> 00:12:13,200 Then in this case the result of this condition would have been false and the break would not have been 159 00:12:13,200 --> 00:12:13,890 executed. 160 00:12:14,160 --> 00:12:22,290 And you would simply jump OK to the default section and you would say the equal to one month plus equal 161 00:12:22,290 --> 00:12:29,970 to one and you would simply increment everything by one and both the month and also the year if it's 162 00:12:29,970 --> 00:12:30,690 necessary. 163 00:12:31,380 --> 00:12:36,270 And once you are done in your out of this, which case you will simply print the next day. 164 00:12:36,280 --> 00:12:37,560 So the next. 165 00:12:39,000 --> 00:12:39,930 The next. 166 00:12:40,770 --> 00:12:53,280 Let's say the next awesome day is and let's use, I don't know, percentage D, percentage D and the 167 00:12:53,280 --> 00:12:59,840 percentage, then, OK, so that's basically what we would have printed out and backslash. 168 00:12:59,850 --> 00:13:09,140 And of course, and we use here day and year, which all of them are already updated to the next day. 169 00:13:09,870 --> 00:13:11,190 So awesome. 170 00:13:11,200 --> 00:13:14,850 Let's build and run it and see what happens if we insert here. 171 00:13:14,850 --> 00:13:15,240 I don't know. 172 00:13:15,240 --> 00:13:16,110 What was it like. 173 00:13:17,340 --> 00:13:18,460 Mm hmm. 174 00:13:18,540 --> 00:13:21,030 Into the day and through the month. 175 00:13:21,540 --> 00:13:26,390 Just an arbitrary I in 1998. 176 00:13:26,970 --> 00:13:30,990 So the next thousand days, twenty six will look awesome. 177 00:13:31,230 --> 00:13:34,050 But if we will have a leap year, let's see. 178 00:13:34,950 --> 00:13:38,460 Twenty eight to February. 179 00:13:38,460 --> 00:13:39,380 Twenty twenty. 180 00:13:39,600 --> 00:13:40,420 So the next day. 181 00:13:40,500 --> 00:13:42,360 Twenty nine of February. 182 00:13:42,360 --> 00:13:43,260 Twenty twenty. 183 00:13:43,830 --> 00:13:44,520 Awesome guys. 184 00:13:44,520 --> 00:13:51,210 So I think this program works perfectly even if we take like twenty eight February 2019, which is not 185 00:13:51,210 --> 00:13:51,840 a leap year. 186 00:13:51,870 --> 00:13:55,580 So the next day's the 1st of 2019. 187 00:13:55,590 --> 00:13:58,530 So awesome, awesome, awesome, awesome. 188 00:13:58,530 --> 00:14:04,490 Guys still if you have any questions about this exercise, it was not so easy, it was kind of difficult. 189 00:14:04,740 --> 00:14:13,620 Feel free to ask me and yeah, hopefully you like the video and you like the solution and you feel like 190 00:14:13,620 --> 00:14:15,180 you're getting more confident. 191 00:14:15,500 --> 00:14:24,990 You're developing real programs that may find the next day based on a given day, which is already showing 192 00:14:24,990 --> 00:14:25,920 your progress. 193 00:14:26,430 --> 00:14:28,680 So let me know if you like this video. 194 00:14:28,680 --> 00:14:34,140 If you like the course so far, if you like the way of teaching, your review really matters. 195 00:14:34,140 --> 00:14:40,020 And it keeps me motivated for creating you additional content and additional courses. 196 00:14:40,770 --> 00:14:42,590 So thank you so much for watching. 197 00:14:42,600 --> 00:14:46,370 Have a great day and I will see you in the next videos. 198 00:14:46,380 --> 00:14:47,040 Of course. 199 00:14:48,060 --> 00:14:50,100 Until then, my name is Vlad. 200 00:14:50,250 --> 00:14:54,510 This is Alphatech and I will see you guys by. 18323

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.