All language subtitles for 5. Exercise 2 - Multiplication Table - 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
hu Hungarian Download
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

Oh, wow, that's a nice example in this exercise, what we are going to do is to write some code that

is responsible for printing the multiplication table, just like the one you've learned when you were

about six or seven years old.

And we are going to write this multiplication table from one to ten, I think will be enough.

OK, so that's what we are going to do.

And we are going to solve this exercise by using none other than our two dimensional array.

So I hope you're ready and let's go.

And first thing that we have to do here is to define some size.

OK, so let's give here like a size, OK?

And the size will be of a size 11.

And I will explain you right away why we use here 11 instead of 10.

And basically, just a quick reminder to you guys, whenever you will see size in our program by using

these define it will be replaced even before the compilation phase.

It will be replaced by the value of eleven.

So since we know that we are going to work with two dimensional arrays, probably we are going to iterate

over each of them ever.

We are going to iterate over the rows and the columns.

So for that, we've seen in the previous exercise that we are going to use and I and J for that.

OK, and also what I want to do is to create or basically initialize our metrics, our two dimensional

array with the size of size by size.

It will be a square square, two dimensional array, just like we would have expected of a multiplication

table.

And now what I want us to do is to started from our equals to zero as long as I is less than size,

iterating over all the rows and now inside it, we are going to iterate over all the columns right so

close to zero G is less than size and J plus plus.

And what we are going to do right now is to specify we are basically going first of all, to feel OK,

so let's call this step.

That will be our first step.

So step number one.

Step one is to feel the values in the table.

OK, so that will be the step one.

And we will feel the values because first of all, now we just declared it right.

It's not initialized.

So we are going to feel the values and we can say that the matrix OK, at Index I j at Index I j meaning

the value of the element at Row II and column J will be equal to I multiplied by J.

OK, that's how the multiplication table works, right.

You take the value from the row and multiplied by the value of the column.

So very simple.

And the only thing that I want to mention here is regarding the size of eleven.

I mean, why would I define it of size 11?

And the reason is very simple, because if we start on both of these of loops from zero, then we know

that we will get like zero values at the leftmost column and the upper row will be also zero is because

everywhere that I is going to be equal to zero in J will be equal to zero, you will simply get a bunch

of zero soon.

You may also try it, but the result will be very disappointing.

But let's let's also give it a shot that you will understand exactly what I meant.

So let us proceed and go like this.

So for OK, now basically we are going to do step two and this step is printing the multiplication table,

multiplication table.

So that's what we are going to do.

So for I equals to zero as long as I is less than this size, I plus plus in here, what we are going

to do is to print these, these two dimensional array just like we've done in the previous video.

So four J equals to zero as long as is less that size J plus plus.

And here we are going to use print F and we are going to specify here percentage and specify the value.

OK, let's just use some space here.

Specify the value of a at index.

I hate index cymatics index I and index J.

OK, row I.

Index wrote a column J and awesome.

And once we are out of these.

Look, we are going to print in your line so that it will look like a real two dimensional matrix and

now what we are going to do is simply to build it and run it and let's see what we have here.

So basically, as you go, you can see here like these kind of two dimensional array, but things are

getting a little bit out of balance here.

So let's just add some R representation here using these four or maybe even maybe even five, we let's

use five that we will see it real nice.

OK, so there you go.

Let's just increase the size.

OK.

Awesome.

Awesome, awesome.

So there you go.

You have your multiplication table.

And one thing that I don't really like here is these zeros and these zeros.

And they happen due to the fact that I start from zero in just hours, from zero.

So what I suggest to do is to start both of them from one and start this also from one.

And this way, if we're building run it, we will see something very, very beautiful.

We will see actually the multiplication table that you have been seeing probably when you was when you

were like six, seven years old.

So one multiplied by one is one.

Two multiplied by one is two, let's say five multiplied by two is ten.

And you go like this, five multiplied by four is twenty.

And you have created your OK, that's yours guys.

You created your first multiplication table and it's actually looking amazing.

And what's what's the best part here is that you can also let's say you wanted like to increase the

size of this multiplication table and let's say you wanted to go like with twenty.

So you will just build and run it and let's increase it to the fullest.

And there you go.

You have a multiplication table of twelve twenty by 20 so you can increase it however you like.

You have two dimensional array, you have a full control of its size, its number of rows and arrows

and you know how to set and to feel its values.

And you also know how to print all of its values.

So pretty awesome.

Guys, I think you are starting to get the feeling of how to work with two dimensional arrays.

That's very important.

It's a very useful topic.

He used a lot in even even even in tech interviews.

And also on your exam, it may be used if you are studying this material in these course.

So I think this is it for these video guys.

Let me know what you think of it.

If you have any questions, feel free to ask.

And until next time, I'll see you there.

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