All language subtitles for 8. Challenge 2 - Solution 2

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 in this challenge, you were asked to calculate the area for a given rectangle.

And to do so, you were asked to create two variables of type double, double height and double with.

And, well, these two values should represent the height and the width of the rectangle.

So let's, first of all, print some nice message through the user print F specifying game two to answer

the height and the width of this rectangle.

So, for example, let's use enter height.

All right.

And also we'll use something like that for in Taffe and PTR with lead.

There you go.

Now, we should also add a functionality to read from the prompt from these console application of the

actual values for the height and the width.

And this can be done using this kind of function.

So scan F percentage, L.F..

All right.

We'll are using percentage L.F. for a double variables and we'll place these values inside of height

variable.

So please note that we don't use here percentage D, which is used for integers or percentage F that

is used for float variables.

This variable is of type double standard.

All right.

So also we'll add something like that's gone f pretty much the same percentage L.F. to place the value

that we read from our prompt to the variable with semicolon at the end.

Very good.

So at this point, we should already have our two values that we present on.

The rectangles are higher than we've.

And now all that we means is simply to create another variable, another double variable and call this

variable area.

These variables should hold the result of multiplying height.

And with to represent the area of this rectangle.

So height multiplied by with semicolon.

And now we should just print the result of the screen as we were asked the the exercise in the challenge

itself.

So print f the area of these rectangle rectangle equals two percent.

The JL F right or center left because we use double type variable.

In here we'll just specify area.

So now let's save it and build and run this program.

And there you go.

You can see your council application.

And here is your first message.

You use the print F Command to display these stacks on these these screens.

So answer hi.

And here is a prompt.

These scan F is waiting for you to insert some floating point along the number.

So let's see.

Is something simple like that.

Four point two.

And there you go for the second message and through with.

Let's go with something like five point seven.

And once we hit the enter button, these value, these five point seven is going to be placed inside

of this variable, inside of with the same way as it was done using these height.

Wow.

Where we just specified four point two, it was placed inside of this variable.

So let's hear the enter button.

And there you go.

You can see the actual message displayed here.

The area of this rectangle equals to twenty three point nine four zero zero zero.

We can limited you.

We we've seen it in the previous section.

We can limit it to just two numbers, two digits after the decimal point.

So one last thing I want to add here is two years a new line between these on formation.

This area over this recht and going round separated a little bit of these.

Default.

Our message is that it won't confuse you guys.

So let's just add a backslash in here and save, build and running once again.

And let's do something like that.

Three point two.

Five point four.

And there you go.

You can see the whole separation and you can see this line representing all the information that you

need.

So to summarize everything up, we simply developed a program that we can shift to different users.

This program is intended to be used by people who just want to find the area for a given rectangle that

they have.

So they have the values for the height and or with.

And they want to find out what is the area of this rectangle instead of I dunno, instead of just using

a calculator, they just want to use your awesome program.

And that's exactly what you provide, what your program provides.

And although it's a simple program, it's also a start.

Then you can see you can see how we are moving forward, how we are getting better every day and every

section and every video and every challenge.

So I hope you can also see it.

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