All language subtitles for 25. Milestone 2 - Solution!

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
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
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 I see you are really curious and interested in knowing how much money can you get, aren't you?

So to get a good answer for that, let's write a program that will be able to distinguish between the

two options and to give us some colleagues later decision with the best choice.

So for that, we will, first of all, create our eye variable because we are going to use Loop's here,

right?

Because we have 30 days.

And what is better to use here rather than using just a for loop?

So for a for a loop, we are going to create an eye variable.

So Amed I in this variable will simply represent the day we are currently at.

Right.

We want to find out how much money we're getting after 30 days.

So also we are going to create another variable and call it.

Let's see.

Week.

Week.

Let's say a week.

Some.

OK.

And week song is just the sum of all the money of all the million dollars we can get right now.

I mean, quickly, we can get it.

So one million.

One million dollar.

OK.

And also we are going to gabbed all likes double or float.

Doesn't matter.

So float total.

Total a month.

Total amount.

Total amount of money.

So what will what what will it be.

Just one penny.

One cent.

So zero point zero one.

OK.

So that's the amount we have.

And they number one.

So are day number one.

And now we are going to write a scene below.

So we are using for a loop because we know the total amount of times we have to use.

Some some commands.

So I equals to one.

And as long as I is less or equals to 30.

We are going to run this little body and hour after every iteration.

We are going to increment I by one.

So meaning a total of 30 times the loop body is going to be executed.

And on every iteration we are going to double to double to multiply by two.

That are up to the total amount.

So we are going to use total amount.

Equals to the previous total amount multiplied by two.

Is this OK?

We simply multiply the total amount every day.

And once we are out of these loop, once we are done running of these loop 30 times, using this multiplication,

we are going to receive here at this point.

We will have the total amount after 30 days.

So will it be better than just getting to the quick some that one millions dollar right away?

Let's find out.

So we can use least printf command.

And just to specify something like this.

So.

Printf total amount.

Total.

Total amount.

Total amount.

After 30 days.

30 days, please.

Let's see.

Percentage.

F.

Right.

It's a floating point.

Yes.

And a backslash.

And at the end.

And instead of that, we are going to specify here that the total amount semicolon at the end.

And there you go.

And now it's tried to build and write and see what happens and what's the amount of money that we are

getting.

So build and run it.

And let's see what happens.

Oh, wow.

Oh, well, how much is that?

So here we have this thousand.

Basically, it's more we are getting more than ten million dollars.

OK.

So that's pretty amazing, guys.

That's over ten million dollars.

And it's much better, probably, right, than just getting today one million dollars.

If we know that after 30 days, if we get today one penny, one cent, we are going to end up with more

than ten million dollars.

That's amazing video thing.

That is the case.

My bet.

Not all of you.

OK.

So what I want you to notice here is two little let's let's just add some command commands that will

demonstrate the process of the calculation.

Let's just bring down the total amount of money earned at each day.

So I want to know how much money, how much money I had on day one.

Day two.

And after 30 days.

OK.

And to do so, we are simply going to add these primitive flying in the loop body and we are going to

do it here.

So print F, print F and specify the number of the day.

So day percentage D.

OK.

We are going to take day one.

So that's will be the I value and the two and day three and so on on every duration.

And we are going to specify like this and amount.

And let's do it like percentage.

What was it like.

Percent.

Two F.

And here we are going to specify the amount of money we have at each day.

So there you go.

Backslash and and here we are going to specify.

I write for these percentages.

And for these percentage F, we are going to specify the total amount.

So far gained up to these days.

All right.

So that's good enough.

And now let's let's just explain once again what this point to means.

It's simply edited to specify that only two digits after the floating point number that we are going

to get hearing total amount that only two to two digits are allowed after the floating point.

OK.

Good, good, good.

So now, guys, you even made sure that we will see all the process.

So let's just build and run it right now.

And we can see that on day number one, we have one penny, two pennies and day two for penny some day

three.

And after 20 days, we have already ten thousand dollars.

And on day twenty eight, we already have more than a million dollars.

And day 30.

And what we're missing here is that we print on day one.

Day two, the three previously I printed out after what will be the result of there.

So that's the first day.

And for 30 days.

OK, so we have to print also day 31 because we started already from day one and we want to do this

process for a 31 days.

So that's ah, that's the last messages.

The total amount after 30 days.

It's day number thirty one after 30 days.

So I hope that's clear, guys.

And now you know how how this process works and you know how what you would choose if somebody would

ask you what you prefer, a million dollars or just one penny doubled for the next 30 days.

So that was a very interesting question.

And what I want you to know here is don't rush to decide any arbitrary decisions.

Think about it.

And if you can even write a program that will find out what is the better solution for you.

Thank you guys for watching.

Sure.

This video with your friends.

Let them know this question.

Actually, share it with your friends.

Ask them what they will prefer and prove them if they're wrong.

I'll see you in the next video.

Goodbye.

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