1 00:00:01,320 --> 00:00:02,130 ‫Welcome back. 2 00:00:02,160 --> 00:00:05,490 ‫Now that you know how to use properties, it's time for a little challenge. 3 00:00:05,490 --> 00:00:07,500 ‫And this one is really just a little one. 4 00:00:07,500 --> 00:00:13,860 ‫So please go ahead and create a read only property called Front Surface, which calculates the front 5 00:00:13,860 --> 00:00:16,110 ‫surface based on height and length. 6 00:00:16,830 --> 00:00:19,530 ‫So please pause the video and try to do that, please. 7 00:00:21,540 --> 00:00:22,200 ‫All right. 8 00:00:22,290 --> 00:00:23,400 ‫I hope you tried it. 9 00:00:23,400 --> 00:00:31,260 ‫I'm just going to create it at the bottom below all of our properties, and I'm going to make it an 10 00:00:31,260 --> 00:00:34,470 ‫int and call it front surface. 11 00:00:36,090 --> 00:00:42,540 ‫And now in here I only have a get because it's a read only, so I cannot set it. 12 00:00:42,540 --> 00:00:43,820 ‫That's really important. 13 00:00:43,860 --> 00:00:52,020 ‫Return height multiplied with length that we are. 14 00:00:52,260 --> 00:00:57,210 ‫So now of course when we do that we should also check it out. 15 00:00:57,210 --> 00:01:02,700 ‫So I didn't write that as a challenge, but of course you want to see what the front surface is. 16 00:01:02,700 --> 00:01:13,830 ‫So I'm just going to write C double DU and here it's going to be front surface of the box is and then 17 00:01:14,490 --> 00:01:24,900 ‫it's going to be the box dot front surface and of course the comma has to be placed there as well. 18 00:01:24,900 --> 00:01:26,460 ‫So now let's run it. 19 00:01:28,340 --> 00:01:31,250 ‫And we are front surface of the box is 20. 20 00:01:31,550 --> 00:01:33,950 ‫That is a length times height. 21 00:01:33,950 --> 00:01:38,780 ‫So five times four is going to be 20 and that's exactly what we have. 22 00:01:38,780 --> 00:01:43,910 ‫So you could go ahead and adjust the box class as you please. 23 00:01:43,910 --> 00:01:49,370 ‫You could add the diagonal, you could add all kinds of things to the box. 24 00:01:49,370 --> 00:01:54,500 ‫For example, the weight you could base the weight on the length and height or on the volume. 25 00:01:54,500 --> 00:02:00,830 ‫So, you know, for example, that it's metal or well, the stone or something like that. 26 00:02:00,830 --> 00:02:06,350 ‫And based on the stone that is in there, you could calculate how heavy it is or whatever you can come 27 00:02:06,350 --> 00:02:06,920 ‫up with. 28 00:02:07,220 --> 00:02:10,370 ‫So that's properties and yeah, see you in the next video.