All language subtitles for 6. Challenge 1 - 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

So hearing this solution, there may actually be a couple of different solutions, and that's probably

okay.

If your solution is not exactly as mine.

So if the program you've written works and you can see that for a different number as you provide,

there are the same numbers of asterisks printed to the screen, then your program probably is correct.

OK, it's.

Don't.

Don't be afraid if it's not the same as the program.

I'm going to show you right now.

I'm going to show you just one option.

So in my option, we've, first of all, will create a variable that will hold the number of asterisks

that need to be printed to the screen.

So let's see.

Is something like this int narm of asterisks.

Ask the risks.

Right, if I'm not mistaken.

Then of course we need to use some input function.

Right.

To read from the user than that number.

So we are going to print enter a number of asterisks.

You would like to see.

OK.

Something like that.

Would like to do.

You would like to see.

We would like to see semicolon at the end.

And here we are going to use the scanning function and to read the value from the console and place

it inside and put it inside these variable.

And now at this point, you already have the number of asterisks that you have to print to the screen.

So to accomplish our task, we are going to use our new body, the loop body, the while loop body.

So simply write the wild statement while here's the parentheses.

And in the parentheses, you specify the condition for when the loop is going to be executed.

So none of asterisks.

As long as normal fast risk is greater than the is then zero.

There in this case, if this condition happens to be true, as long as this condition happens to be

true, we are going to execute a bunch of commands.

So the first command is, of course, the print an asterisk to the screen.

Right.

And that's how you do it.

You printed out one asterisk.

And if you're to run this program right now, actually, let's do it.

But very, very carefully.

If you're about to do it on your own in your home, make sure you're safe.

All right.

So let's build it or run it and let's place here right on all three, for example.

Oh, and we got an infinite loop.

So press control, see if you're using windows.

And we got an infinite loop in this section.

And that's not something that we wanted.

Right.

We want to now at some point to get out of this loop to make sure that this condition in the future

wants seats printed out, all of the necessary asterisks to the screen that it will stop and it will

move on to the next command.

So for that, we are just going to reduce the value of these variables by this variable, by one at

every iteration.

So simply right now or fast risk equals to normal fast risks.

Minus one.

Or you may also use just something like that.

I'm putting it in the comments here.

Now I'm off ask.

There are risks.

Minus minus.

And now on each duration we are going to decrease meant the value of normal fast risks by one.

And we will do so.

And we will do so until we reach zero, which means all the asterisks have been printed on the screen.

And while I.

Your program works.

So let's try to build and run it once again and see what happens.

So let's build and run it.

There we have the message.

Let's use three.

So we have three asterisks.

And also, if we are going to use here, I don't know, a hundred.

Let's see.

So that's probably going to be one hundred of asterisks.

And one less thing to mention here.

And we want to a little bit to separate these message from this default message printed out on the console

application.

So for that, we are going to use a basic Pring def command.

Once we are out, once we are out of the while loop, we are going to use brute F and just print F a

new line.

After we are done printing out all the asterisks here.

All right.

Good, good, good.

So that will work.

And now let's quickly take a look at another solution which is also valid.

Will first define some auxiliary variable and call it.

Let's call it.

I didn't.

I just said it to be equals to zero.

And now let's modify a little bit the while, the while condition.

We are going to say that while I is less than narm of asterisks, because in this solution, in this

example, which by the way, the previous one is valid and this one is a.

Both of them are okay, but some of you may use the previous ones, some of you will use these one,

I just want to show you another way to how it can be done.

So in this case, we don't want to change these variable.

We are just using some auxillary variable called eye that will help us with the solution.

So as long as I is less than an arm of asterisk, we are going to print half an asterisk to the screen.

And also, we are going.

Of course, to increment I by one.

So you either may use I equals two, I plus one or you can just use I plus plus.

So I will increment on each iteration until it reaches out to be equal or greater than normal fast risks.

And when it happens you just step out of the while loop and proceed with this command.

So this is it for these video guys.

Many you find out.

Maybe you found out some other approach to how you can solve it using a while loop.

So just make sure that you can see the expected result.

And the result should be the same of what you see on the screen.

Right.

There are maybe different ways to solve it, but the result here in this example should be the same.

So, as always, guys.

Thank you so much for watching.

And I'll see you in the next video.

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