All language subtitles for 130 Leap Year Solution.en_US

af Afrikaans
ak Akan
sq Albanian
am Amharic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
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
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranรฎ)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

All right so let's try to tackle this challenge.

Step by step.

Now if we look at the flow chart the first question we ask is Is it cleanly divisible by four.

If no then it's definitely not a leap year.

If yes then we have to ask more questions.

So how would we write this in terms of code.

Well we'd probably use an if statement to check if the year that were being passed in here is cleanly

divisible by four.

And remember that on a previous lesson which I linked to here we learned about the modulo operator which

gives you the remainder of a division.

So if the year modulo four is equal to zero namely if there is no remainder when you divide the year

by four.

Well in that case then it's likely to be a leap year.

But if it's not even divisible by four then it's definitely not a leap year.

So here we could simply return not leap year.

So any year that is not divisible by four.

That is definitely not a leap year but if it is divisible by four we still have to check is it cleanly

divisible by 100.

Because if no then it's definitely a leap year.

But if yes then we have to check further.

So the best way to represent that logic is to create another if statement inside this if statement.

So it's already divisible by four.

But we have to check whether if it's divisible by 100.

So if the year modulo 100 is equal to zero Well then we have to make some further checks.

But if it's not then it's definitely a leap year.

So we can return leap year.

Now finally we're in the homestretch and we have to ask ourselves the last question is it cleanly divisible

by 400.

If no then it's not a leap year.

If yes then it is a leap year.

So inside this if statement we're going to ask ourselves one further question if the year is divisible

by 400.

And that has no remainder.

Well then it's definitely a leap year.

And if that's not true then it's definitely not a leap year.

So this is the logic that we saw in the flowchart mapped out with javascript code and going from these

words to code is actually quite a big jump.

But going via that middle ground that flowchart makes it so much easier to actually map out the logic

and then converting it into code.

So hope you enjoy that challenge and you managed to get it right and at least if you didn't you saw

how you can use flow charts to simplify and clarify your own idea of the logic because at the end of

the day the code is easy.

But the logic is the path that you've got to get right first.

So now if we check our solution then everything should pass.

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