00:02
Okay, so this question says write a method met.
00:05
That it takes an integer, height.
00:09
The height contains the height of a person in the centimeter.
00:12
So we want to print out the height in feet and inches, and it gives a nice conversion here.
00:20
So i'll only write the method, so it just wants it to make this function.
00:23
Okay, so let's define met, and it's going to take cm.
00:29
And what it's going to do is going to say, we're going to do so one centimeter equals this name feet.
00:37
So we're going to say feet equals one, or the number of centimeters divided by this number here.
00:49
So then let's return this, let's start by returning feet.
01:00
So for me, for example, i'm 186 centimeters and that is, sorry, this is not correct.
01:09
This should be multiplied here.
01:13
6 .1 feet, okay? and now what we want to do is transfer this decimal, essentially into this base 12 system.
01:25
So we're going to take the difference, basically, between six.
01:34
The nearest integer.
01:36
So let's do rounded equals round.
01:43
Round feet and just to show you what that does.
01:54
Round it is now going to be equal to six and if we had someone who is closer to five feet for example then rounded would be five because feet here is 5 .2 and then if we had someone who is in 170 centimeters which is 5 .57 round it would round up to six.
02:17
So what we're going to do is we actually want to round down, right? so we always are going to want to round down.
02:26
And so instead of rounder, we're going to use int.
02:28
That's actually just going to truncate that number.
02:32
So here we have feet.
02:33
And feet is 5 .57, but rounded is just 5 .7.
02:38
So rounded has always been just removed the entire decimal.
02:42
Okay...