Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,270 --> 00:00:04,630
So in this challenge, you were asked to calculate the area for a given rectangle.
2
00:00:05,010 --> 00:00:12,090
And to do so, you were asked to create two variables of type double, double height and double with.
3
00:00:12,780 --> 00:00:17,520
And, well, these two values should represent the height and the width of the rectangle.
4
00:00:17,700 --> 00:00:25,840
So let's, first of all, print some nice message through the user print F specifying game two to answer
5
00:00:25,860 --> 00:00:27,990
the height and the width of this rectangle.
6
00:00:28,200 --> 00:00:30,960
So, for example, let's use enter height.
7
00:00:31,320 --> 00:00:31,890
All right.
8
00:00:32,790 --> 00:00:38,950
And also we'll use something like that for in Taffe and PTR with lead.
9
00:00:40,350 --> 00:00:41,160
There you go.
10
00:00:41,430 --> 00:00:46,650
Now, we should also add a functionality to read from the prompt from these console application of the
11
00:00:46,650 --> 00:00:48,810
actual values for the height and the width.
12
00:00:49,050 --> 00:00:51,560
And this can be done using this kind of function.
13
00:00:51,590 --> 00:00:54,300
So scan F percentage, L.F..
14
00:00:54,690 --> 00:00:55,200
All right.
15
00:00:55,220 --> 00:01:01,800
We'll are using percentage L.F. for a double variables and we'll place these values inside of height
16
00:01:02,250 --> 00:01:03,060
variable.
17
00:01:03,450 --> 00:01:10,740
So please note that we don't use here percentage D, which is used for integers or percentage F that
18
00:01:10,740 --> 00:01:12,860
is used for float variables.
19
00:01:13,160 --> 00:01:15,250
This variable is of type double standard.
20
00:01:15,420 --> 00:01:15,810
All right.
21
00:01:15,840 --> 00:01:24,990
So also we'll add something like that's gone f pretty much the same percentage L.F. to place the value
22
00:01:25,020 --> 00:01:31,050
that we read from our prompt to the variable with semicolon at the end.
23
00:01:31,290 --> 00:01:31,920
Very good.
24
00:01:31,950 --> 00:01:36,870
So at this point, we should already have our two values that we present on.
25
00:01:36,870 --> 00:01:39,190
The rectangles are higher than we've.
26
00:01:39,480 --> 00:01:45,900
And now all that we means is simply to create another variable, another double variable and call this
27
00:01:45,900 --> 00:01:47,100
variable area.
28
00:01:47,550 --> 00:01:51,270
These variables should hold the result of multiplying height.
29
00:01:51,690 --> 00:01:55,480
And with to represent the area of this rectangle.
30
00:01:55,480 --> 00:01:59,380
So height multiplied by with semicolon.
31
00:01:59,860 --> 00:02:05,730
And now we should just print the result of the screen as we were asked the the exercise in the challenge
32
00:02:05,730 --> 00:02:06,180
itself.
33
00:02:06,420 --> 00:02:14,460
So print f the area of these rectangle rectangle equals two percent.
34
00:02:14,460 --> 00:02:19,030
The JL F right or center left because we use double type variable.
35
00:02:19,470 --> 00:02:21,780
In here we'll just specify area.
36
00:02:22,560 --> 00:02:26,470
So now let's save it and build and run this program.
37
00:02:26,790 --> 00:02:27,690
And there you go.
38
00:02:27,690 --> 00:02:29,490
You can see your council application.
39
00:02:29,760 --> 00:02:31,740
And here is your first message.
40
00:02:32,040 --> 00:02:38,040
You use the print F Command to display these stacks on these these screens.
41
00:02:38,070 --> 00:02:39,110
So answer hi.
42
00:02:39,240 --> 00:02:40,380
And here is a prompt.
43
00:02:40,830 --> 00:02:46,170
These scan F is waiting for you to insert some floating point along the number.
44
00:02:46,410 --> 00:02:46,970
So let's see.
45
00:02:46,970 --> 00:02:48,760
Is something simple like that.
46
00:02:48,780 --> 00:02:50,070
Four point two.
47
00:02:50,130 --> 00:02:53,040
And there you go for the second message and through with.
48
00:02:53,340 --> 00:02:56,220
Let's go with something like five point seven.
49
00:02:56,580 --> 00:03:03,510
And once we hit the enter button, these value, these five point seven is going to be placed inside
50
00:03:03,510 --> 00:03:08,850
of this variable, inside of with the same way as it was done using these height.
51
00:03:09,200 --> 00:03:09,590
Wow.
52
00:03:09,680 --> 00:03:13,410
Where we just specified four point two, it was placed inside of this variable.
53
00:03:13,710 --> 00:03:15,660
So let's hear the enter button.
54
00:03:16,020 --> 00:03:16,890
And there you go.
55
00:03:16,890 --> 00:03:19,890
You can see the actual message displayed here.
56
00:03:20,220 --> 00:03:26,350
The area of this rectangle equals to twenty three point nine four zero zero zero.
57
00:03:26,370 --> 00:03:27,420
We can limited you.
58
00:03:27,500 --> 00:03:30,420
We we've seen it in the previous section.
59
00:03:30,420 --> 00:03:35,760
We can limit it to just two numbers, two digits after the decimal point.
60
00:03:35,940 --> 00:03:42,540
So one last thing I want to add here is two years a new line between these on formation.
61
00:03:42,600 --> 00:03:47,200
This area over this recht and going round separated a little bit of these.
62
00:03:47,370 --> 00:03:47,960
Default.
63
00:03:47,970 --> 00:03:50,370
Our message is that it won't confuse you guys.
64
00:03:50,390 --> 00:03:57,090
So let's just add a backslash in here and save, build and running once again.
65
00:03:57,540 --> 00:03:59,770
And let's do something like that.
66
00:03:59,820 --> 00:04:01,110
Three point two.
67
00:04:01,170 --> 00:04:02,790
Five point four.
68
00:04:03,330 --> 00:04:03,960
And there you go.
69
00:04:03,960 --> 00:04:11,040
You can see the whole separation and you can see this line representing all the information that you
70
00:04:11,040 --> 00:04:11,220
need.
71
00:04:11,550 --> 00:04:17,040
So to summarize everything up, we simply developed a program that we can shift to different users.
72
00:04:17,400 --> 00:04:24,900
This program is intended to be used by people who just want to find the area for a given rectangle that
73
00:04:24,900 --> 00:04:25,470
they have.
74
00:04:25,650 --> 00:04:28,470
So they have the values for the height and or with.
75
00:04:28,770 --> 00:04:35,540
And they want to find out what is the area of this rectangle instead of I dunno, instead of just using
76
00:04:35,540 --> 00:04:40,560
a calculator, they just want to use your awesome program.
77
00:04:40,860 --> 00:04:44,370
And that's exactly what you provide, what your program provides.
78
00:04:44,580 --> 00:04:47,810
And although it's a simple program, it's also a start.
79
00:04:47,890 --> 00:04:54,180
Then you can see you can see how we are moving forward, how we are getting better every day and every
80
00:04:54,180 --> 00:04:56,490
section and every video and every challenge.
81
00:04:56,760 --> 00:04:59,400
So I hope you can also see it.
7293
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.