Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
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.