1 00:00:00,660 --> 00:00:01,740 ‫Welcome back. 2 00:00:01,770 --> 00:00:08,180 ‫In this video, we are going to check out the solution for the challenge of the last lecture. 3 00:00:08,190 --> 00:00:13,930 ‫And let's go ahead and start with understanding what the challenge was about. 4 00:00:13,950 --> 00:00:20,640 ‫So, first of all, I wanted you to create a variable for each of the different data types that you 5 00:00:20,640 --> 00:00:28,230 ‫can find on the Microsoft website, and you can find more details about the data types here. 6 00:00:28,260 --> 00:00:36,240 ‫But what we want to create is one variable for each of those data types, and also they need to have 7 00:00:36,240 --> 00:00:37,830 ‫the correct value. 8 00:00:38,280 --> 00:00:38,670 ‫All right. 9 00:00:38,670 --> 00:00:41,070 ‫So let's go ahead and check it out. 10 00:00:41,100 --> 00:00:45,560 ‫Let's start with Byte, then go ahead with SE byte, end and so forth. 11 00:00:45,570 --> 00:00:51,360 ‫And while I could show you how to type all of that in, I think it makes more sense to simply go through 12 00:00:51,360 --> 00:00:54,690 ‫the code and explain you what the reasoning was behind that. 13 00:00:54,690 --> 00:01:01,830 ‫So first of all, I have a byte which I called my byte and I assigned a value of 25 to it. 14 00:01:03,130 --> 00:01:10,510 ‫And as you might know, the value range for the byte is between zero and 255. 15 00:01:10,600 --> 00:01:18,460 ‫So I just took a random value out of those numbers and then I added it to my console by adding right 16 00:01:18,460 --> 00:01:19,170 ‫line. 17 00:01:19,180 --> 00:01:22,600 ‫So console dot red line and the name of the variable. 18 00:01:22,780 --> 00:01:31,570 ‫The same thing with the byte, which is just a short byte which can have negative values, but only 19 00:01:31,570 --> 00:01:35,830 ‫between minus -128 and 127. 20 00:01:35,890 --> 00:01:38,170 ‫Then we have the my int. 21 00:01:38,170 --> 00:01:43,360 ‫It's an integer which can have negative values and positive values, then the other end which can have 22 00:01:43,360 --> 00:01:45,290 ‫even larger values. 23 00:01:45,310 --> 00:01:51,220 ‫So just based on the range that you can find here and as you can see, it has a larger value. 24 00:01:51,250 --> 00:01:54,460 ‫The width is the same, so it's positive now. 25 00:01:55,120 --> 00:01:56,550 ‫So it only can be positive. 26 00:01:56,560 --> 00:01:58,210 ‫You can only be positive. 27 00:01:58,210 --> 00:02:06,220 ‫Then you have the short variable here and I took the lowest value possible for a short variable and 28 00:02:06,220 --> 00:02:13,690 ‫you can find that here or for a variable with the short data type, it's -32,768. 29 00:02:14,470 --> 00:02:19,440 ‫Then the you short is only positive and I took the highest value possible. 30 00:02:19,450 --> 00:02:27,010 ‫Then you have the float which can be negative and is a floating point number and it's important to have 31 00:02:27,010 --> 00:02:32,230 ‫the F at the end and it can be either a capital F or a non capitalized F. 32 00:02:32,320 --> 00:02:39,040 ‫Then I have my double, which is an even longer value in terms of even more digits behind the decimal 33 00:02:39,040 --> 00:02:39,690 ‫point. 34 00:02:39,700 --> 00:02:46,570 ‫Then I have a character which is a capital A in my case, which is simple, simply one single character. 35 00:02:46,570 --> 00:02:49,690 ‫And as you can see, I had to use apostrophes here. 36 00:02:49,840 --> 00:02:54,080 ‫Then we have a boolean which can either be true or false and it shows true. 37 00:02:54,100 --> 00:02:58,120 ‫Then my text, which I told you to use, I control text. 38 00:02:58,450 --> 00:03:05,110 ‫And then finally we have a num text which is a number in form of a string. 39 00:03:05,110 --> 00:03:14,710 ‫And I chose the value 15 here and I used parse in order to create an integer out of this num text. 40 00:03:14,710 --> 00:03:22,570 ‫And here I used int dot parse to use that you could have used the n 32 dot parse as well. 41 00:03:22,570 --> 00:03:24,670 ‫So in the end it's the same thing. 42 00:03:24,700 --> 00:03:26,710 ‫It's just a different way of approaching it. 43 00:03:27,220 --> 00:03:33,910 ‫All right, then we have the console right line in order to write that text onto the console, which 44 00:03:33,910 --> 00:03:37,150 ‫is just this 15 in terms of an integer. 45 00:03:37,420 --> 00:03:39,880 ‫And then we read everything out. 46 00:03:39,880 --> 00:03:45,970 ‫So our console gets filled with all those values, which should be plenty, as you can see. 47 00:03:45,970 --> 00:03:53,950 ‫So more than ten different data types and that we are 25, 15 or -15 and so forth. 48 00:03:54,790 --> 00:03:55,210 ‫All right. 49 00:03:55,210 --> 00:03:56,670 ‫I hope you manage to do that. 50 00:03:56,680 --> 00:04:02,650 ‫It's not really that difficult, but it's more about just for you to get an understanding of the different 51 00:04:02,650 --> 00:04:08,440 ‫data types and what the range is and also understand how many bits they use and so forth. 52 00:04:08,590 --> 00:04:12,220 ‫That's something that will come in handy for further programming. 53 00:04:12,220 --> 00:04:18,040 ‫When you have to decide which data type you want to use for your variable, then you always can check 54 00:04:18,040 --> 00:04:23,830 ‫out the Microsoft website or you can go back to this lecture and check out what the values were and 55 00:04:23,830 --> 00:04:26,770 ‫understand a bit better what to choose.