All language subtitles for 18. Exercise 3 - Writing numbers and their powers to a file[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

So let us start the solution, shall we?

So let's create a pointer, F.P., a pointer to a file.

Let's open it up and let's make sure that it was opened up successfully.

Now, let's use here some let's use some loop, some for a loop.

Let's create additional variable AI and we'll use it like this.

So for I equals zero, the one in this case.

Right.

Because we know zero in the power of zero.

What does it mean.

Well what, what will it be.

So I equals to one eye is less than what did we want.

We want up until 10.

So let's say equals small less than or equal to ten and then we will say a plus plus one every duration.

And now what we are going to do.

We need a way to take the information stored inside these variable eye and put it inside the file,

and also we need to put the information from I multiplied by so we could weigh a good function would

be in this case is the print F function file, print file.

What does he expect to receive?

It expects to receive a pointer to file.

Let's give it F.P. and then what should we give it.

We should give it a second is the Charr format, so what will it be?

What are the placeholders in this case we should use here person the unique.

OK, I just want to show you a simple example of just using the percentage deal without the powers themselves,

so let's use it like this.

So we will write to the file all the numbers, one, two, three, four or five, six, seven, up until

we reach some value.

So let's wait up until we reach them.

So let's say the coalition run it and let's hope that everything will work.

Where is the file?

Come on.

Come on, come on.

Here it is.

Here is the file.

One, two, three, four, five, six, seven, eight, 10, nine.

Eight, nine, ten.

Yeah, absolutely, so what we want now, these files to have is something like this one for nine and

so on.

So what should we do?

We should basically update the printer offline.

So instead of using just percentage D, we will use percentage D the number and then we will specify

a space and we will use another number specified by percentage.

That's it.

Here we will specify I multiplied by I which is.

Which is which is why do you think it is I it is the power of two or five, so let's run it and hopefully

everything will work smoothly so we can finish it up.

So one, one, two, four, three, nine four, six, five twenty five, six and so on.

So I think you've got the idea and if you would like to make like to expand it a little bit, very easy.

Just Adelaida know up until a hundred and there you go, you will have your file with all the values

of I and I square.

Awesome.

So, yeah, this is it for this video.

We used the printer function, specified the file pointer, specified some format specifications, including

placeholders specified I, I multiplied by AI and that's it.

So thank you guys for watching.

You're doing great.

And let's move on to the next video.

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