1 00:00:00,980 --> 00:00:02,000 Hey guys welcome back. 2 00:00:02,000 --> 00:00:06,990 So this time I'm going to open my project for using Visual Studios interface. 3 00:00:07,010 --> 00:00:12,710 So I open Visual Studio and then to the left they're showing me all of the recent projects that I have 4 00:00:12,890 --> 00:00:16,810 done so I'm just going to select this my project from the list. 5 00:00:16,850 --> 00:00:22,430 I can also pin it because maybe you know I have a bunch of projects working on and I want this one to 6 00:00:22,430 --> 00:00:29,480 be at the top always so I can just print it and then I can just go ahead and click it and open it and 7 00:00:29,480 --> 00:00:32,600 then Visual Studio will launch with my projects. 8 00:00:32,600 --> 00:00:38,270 So Visual Studio is putting us right back where we left off which is when we were doing that input output 9 00:00:38,270 --> 00:00:38,850 program. 10 00:00:38,960 --> 00:00:44,400 But this time we're going to be looking at some data types so I'm going to create a new project. 11 00:00:44,430 --> 00:00:47,210 So that the solution go to 12 00:00:49,810 --> 00:00:52,540 ad and then select new project 13 00:00:55,200 --> 00:00:58,490 and then when the console comes up the dialog box comes up. 14 00:00:58,530 --> 00:01:06,600 I just select console Dalton core and then click next and then this time the project name that I want 15 00:01:06,870 --> 00:01:10,530 is variables and data types. 16 00:01:10,560 --> 00:01:20,120 So variables and data types and then I click Create. 17 00:01:20,140 --> 00:01:24,540 Now I did say that C Shabaab boasts a wide collection of data types. 18 00:01:24,540 --> 00:01:31,890 There are simple data types and there are user defined data types so that the basic ones that you have 19 00:01:31,890 --> 00:01:37,720 with all those the simple data types which are like the string and you know four numbers and so on now 20 00:01:37,730 --> 00:01:39,450 we're going to go through some of them. 21 00:01:39,450 --> 00:01:43,720 That being said there are a lot so I'm not going to go through every single one. 22 00:01:43,830 --> 00:01:49,940 And along the way we may end up using one or a few that we didn't cover in this video. 23 00:01:49,980 --> 00:01:53,960 So I'll go through the basic ones that you definitely need to know. 24 00:01:54,030 --> 00:01:59,190 But as we go along you will see others that contextually you may need. 25 00:01:59,190 --> 00:02:03,630 I also want to point out that C sharp is what you call a strongly typed language. 26 00:02:03,630 --> 00:02:09,360 So that means that if you are going to declare a variable that should hold text then it's going to treat 27 00:02:09,360 --> 00:02:10,370 it like text. 28 00:02:10,380 --> 00:02:17,550 So even if I put one as in the numeral one instead of a text variable it won't treat it like a number 29 00:02:17,550 --> 00:02:18,960 to do math with it. 30 00:02:18,960 --> 00:02:24,560 So you have to choose your data that was very carefully based on what operation you want to carry out. 31 00:02:24,570 --> 00:02:25,820 So let's start off. 32 00:02:25,850 --> 00:02:27,270 So we did see string. 33 00:02:27,270 --> 00:02:36,540 So let me say variable declarations and type someone to use this section just define some variables 34 00:02:36,930 --> 00:02:39,390 and we can look at what they are. 35 00:02:39,390 --> 00:02:41,340 So one string. 36 00:02:41,370 --> 00:02:48,460 So we went through a string pretty string and I'm going to say name then maybe you will want to collect 37 00:02:48,550 --> 00:02:49,810 the age also. 38 00:02:49,840 --> 00:02:50,080 No. 39 00:02:50,080 --> 00:02:53,450 Are we going to store somebodies age as string. 40 00:02:53,590 --> 00:02:56,430 Or are we going to store their age as maybe a number. 41 00:02:56,430 --> 00:02:58,460 Because if I tell you I'm 10 years older than you. 42 00:02:58,480 --> 00:03:02,100 Then you want to do some math to see okay as a 10 year old. 43 00:03:02,200 --> 00:03:06,970 This is mathematically whole you're going to be X Y Z or something like that. 44 00:03:06,980 --> 00:03:09,580 You know you may want to do a mathematical operation. 45 00:03:09,640 --> 00:03:14,750 You cannot use a string variable for math so you want to use what you call an INT. 46 00:03:14,890 --> 00:03:20,830 So into short for integer and that one an integer is basically a number that doesn't have any decimal 47 00:03:20,860 --> 00:03:21,210 places. 48 00:03:21,220 --> 00:03:27,020 So if you put a decimal number inside edge like you say they are twenty two point five years old because 49 00:03:27,040 --> 00:03:29,740 an int is going to ignore the point five. 50 00:03:29,800 --> 00:03:35,410 You do have other variables that call it that so I could probably make one that's a salary so I could 51 00:03:35,420 --> 00:03:37,790 say double salary. 52 00:03:38,890 --> 00:03:42,170 So double will take a decimal point. 53 00:03:42,220 --> 00:03:43,410 All right. 54 00:03:43,540 --> 00:03:49,570 You also have another data type called float that does this small points but then based on the number 55 00:03:49,660 --> 00:03:55,440 of decimal places you know that that's where there really difference the number of decimal places on 56 00:03:55,440 --> 00:03:57,670 the precision that is a load. 57 00:03:57,670 --> 00:04:04,150 In simpler terms you know you may have like a value like Pi which we all know as a decimal is three 58 00:04:04,150 --> 00:04:08,170 point one for something something something something something double. 59 00:04:08,460 --> 00:04:09,520 I'm floored me. 60 00:04:09,520 --> 00:04:14,830 End of story and different values because one will be more precise than the other. 61 00:04:14,860 --> 00:04:22,330 You also have what you call a char so a char is short for a character and a char variable is usually 62 00:04:22,330 --> 00:04:24,540 used for a single is not usually used. 63 00:04:24,550 --> 00:04:25,570 It is used. 64 00:04:25,570 --> 00:04:31,780 Sorry for a single character so case study or a case for that would be like gender. 65 00:04:31,870 --> 00:04:32,160 Right. 66 00:04:32,170 --> 00:04:35,470 So charge under you're either m or f. 67 00:04:35,470 --> 00:04:40,390 Another very popular basic data type that we would see is boolean. 68 00:04:40,390 --> 00:04:44,100 So we have bool and then I went to use this one to see it working. 69 00:04:44,110 --> 00:04:46,210 So bool means yes or no. 70 00:04:46,390 --> 00:04:48,180 It's either true or false. 71 00:04:48,380 --> 00:04:49,920 It is either one or zero. 72 00:04:49,930 --> 00:04:55,190 There is no other value that can go in said a bool but true or false. 73 00:04:55,210 --> 00:04:56,680 So let's recap real quickly. 74 00:04:56,680 --> 00:05:00,640 So we have string name so string takes takes the takes. 75 00:05:00,640 --> 00:05:08,080 Anything that is it can take any alphanumeric and character combination is just going to receive something 76 00:05:08,320 --> 00:05:09,670 and then print it back. 77 00:05:09,760 --> 00:05:12,660 You can't do any math on the numbers you put in there. 78 00:05:12,760 --> 00:05:19,150 You'll have to do conversions and it while it's relatively easy to do conversions I just recommend that 79 00:05:19,150 --> 00:05:21,680 you use the right variable when you need it for a certain thing. 80 00:05:21,700 --> 00:05:25,520 So if you have a string it's clearly not to do any math. 81 00:05:25,570 --> 00:05:31,310 If we have an integer it's because we want a number and we're not expecting decimal places. 82 00:05:31,360 --> 00:05:36,020 If we have a double that means we can get a number and we might have decimal places. 83 00:05:36,100 --> 00:05:39,550 We have char because we're expecting one character. 84 00:05:39,550 --> 00:05:46,900 This one character can be of any first equation meaning can be a letter a number a special character 85 00:05:46,930 --> 00:05:52,060 but it's only going to be 1 so you can put your name inside of a char. 86 00:05:52,060 --> 00:05:52,480 All right. 87 00:05:52,630 --> 00:06:02,620 So for this example we're going to accept M or F for gender and then we have the boolean right which 88 00:06:02,620 --> 00:06:05,930 can only be true or false. 89 00:06:05,930 --> 00:06:11,290 Now we just wrapped up a session of both prompting users for input so what I'm want to do is from them 90 00:06:11,290 --> 00:06:17,200 for their name their age their salary their gender and if they're working or not. 91 00:06:17,200 --> 00:06:22,450 So I'm just going to do about two of them and then I'm going to allow you to try and do the rest. 92 00:06:22,450 --> 00:06:27,850 So I want to say console dot and then remember we have to print to the screen. 93 00:06:27,910 --> 00:06:32,550 Hey I'm asking you for this data right here and someone to use right. 94 00:06:32,650 --> 00:06:36,630 And then you will see the difference in the problems when I use right instead of right line. 95 00:06:36,700 --> 00:06:43,550 But then I'm prompting this time for a name someone to say enter your name colon. 96 00:06:43,780 --> 00:06:49,190 And then after that I'm going to say a name should get b get the value from the consul's. 97 00:06:49,180 --> 00:06:56,120 The name is no equal to console dot read line and open and close burning the seats. 98 00:06:56,170 --> 00:06:57,370 That's the name prompt. 99 00:06:57,400 --> 00:06:57,800 Right. 100 00:06:58,040 --> 00:06:58,650 No. 101 00:06:58,660 --> 00:07:06,130 To expedite this process I can just copy if I want I can just copy those two lines go down and paste 102 00:07:06,520 --> 00:07:09,700 and then I just change all the text so I asked for a name. 103 00:07:09,700 --> 00:07:14,200 This time I want age and then the pattern is the same. 104 00:07:14,200 --> 00:07:19,030 All I have to say is age is equal to console dot redesign. 105 00:07:19,060 --> 00:07:23,500 No notice I'm getting an arrow and I'm asking for that age all right. 106 00:07:23,500 --> 00:07:27,120 And then that's where r conversions come into play. 107 00:07:27,150 --> 00:07:31,630 So I did say that this is variable data type and conversions right. 108 00:07:31,720 --> 00:07:39,520 So in this situation it is seeing that there is an error cannot implicitly convert type String to int 109 00:07:39,810 --> 00:07:40,230 No. 110 00:07:40,390 --> 00:07:46,450 This didn't receive that arrow because console dot read line is getting some keyboard input from the 111 00:07:46,450 --> 00:07:52,150 console which it is transporting to the variable in the form of a string. 112 00:07:52,150 --> 00:07:58,540 So in this situation I did say that it strongly type sitcom com puts a word inside of a variable that 113 00:07:58,540 --> 00:08:00,770 is expecting a number. 114 00:08:00,790 --> 00:08:08,650 So this number variable is expecting a number to be input but the mechanism we're using to get the data 115 00:08:08,680 --> 00:08:10,340 is transporting a string. 116 00:08:10,360 --> 00:08:11,650 So that's a problem right. 117 00:08:11,950 --> 00:08:20,050 So no we have to run what we call a conversion where we accept the string converted to it and all of 118 00:08:20,050 --> 00:08:22,650 that before it gets into the variable. 119 00:08:22,660 --> 00:08:28,860 So what I'm going to do is erase this and I'm going to rewrite this line step by step. 120 00:08:29,350 --> 00:08:34,880 So C sharp gives us tools to convert and literally they give us a class called convert. 121 00:08:34,900 --> 00:08:43,750 So we can write the word convert and then see a dot and then we have a number of conversions available 122 00:08:43,750 --> 00:08:44,100 to us. 123 00:08:44,110 --> 00:08:48,850 We can convert it thirty in to double to date time all sorts of things. 124 00:08:48,850 --> 00:08:53,490 So I want to int thirty two and then I open. 125 00:08:53,500 --> 00:08:55,230 So this is a function right. 126 00:08:55,250 --> 00:08:59,290 And we do in all functions is because they have open and close parentheses. 127 00:08:59,380 --> 00:09:06,400 Then inside of this function because notice is still as I red line it saying that it expects some value. 128 00:09:06,400 --> 00:09:06,760 All right. 129 00:09:06,790 --> 00:09:15,010 So no I need to tell it what exactly I want to convert and what I want to convert is the input coming 130 00:09:15,130 --> 00:09:16,690 from the console. 131 00:09:17,050 --> 00:09:21,900 So I'm going to call the console that read line when it gets there it's going to prompt the user is 132 00:09:21,910 --> 00:09:25,750 going to pause get the input when the user presses enter. 133 00:09:25,750 --> 00:09:29,470 So remember that this pauses for input until it sees enter. 134 00:09:29,470 --> 00:09:40,420 Once the person presses enter it's then going to convert it to int or 32 bit signed into Joe. 135 00:09:40,420 --> 00:09:45,130 All right so just does a fine so they'll see and puts it in an integer and you did see it too. 136 00:09:45,160 --> 00:09:50,450 You did see two thirty two in thirty two and two into sixteen. 137 00:09:50,450 --> 00:09:51,830 Anyway I've seen on the numbers. 138 00:09:51,850 --> 00:09:56,430 The fact is the larger the number is the more bits required. 139 00:09:56,430 --> 00:09:56,690 Right. 140 00:09:56,730 --> 00:09:59,710 So two thirty two is pretty much standard. 141 00:09:59,710 --> 00:10:06,420 We can leave it with thirty two and then once it is converted then it is assigned to our age variable. 142 00:10:06,430 --> 00:10:08,920 I notice all is well in the universe. 143 00:10:08,920 --> 00:10:14,280 There are no more errors so I'm going to do the rest and I'm not going to do any conversions just yet. 144 00:10:14,290 --> 00:10:19,540 I'm going to pause here and I'm words I love you to try and write the problems for each of the other 145 00:10:19,540 --> 00:10:24,400 three variables and then we can look at the potential arrows together. 146 00:10:24,610 --> 00:10:25,030 All right. 147 00:10:25,300 --> 00:10:27,970 The rest of my problems and I change that takes accordingly. 148 00:10:27,970 --> 00:10:33,400 Enter celery enter your gender and then for the one with working I kind of change the verbiage because 149 00:10:33,400 --> 00:10:37,600 once again you want to tell the user what kind of data you're expecting from them so you don't want 150 00:10:37,600 --> 00:10:42,400 to leave it up to them to infer what they should be putting in. 151 00:10:42,400 --> 00:10:44,350 So I said Are you working. 152 00:10:44,350 --> 00:10:48,450 True or false sense yes but true wrongly so true or false. 153 00:10:48,460 --> 00:10:54,340 So we're expecting them to enter the word true or the word false but more importantly notice how many 154 00:10:54,340 --> 00:10:58,310 errors we have and the same reason that we had the error for it. 155 00:10:58,310 --> 00:11:04,090 It is the same reason we're having these errors because consulate read line is returning a string but 156 00:11:04,090 --> 00:11:06,960 the string cannot be put into a double. 157 00:11:06,960 --> 00:11:09,490 Just like that kind of input into a char does that. 158 00:11:09,790 --> 00:11:13,210 And it can't be put into a boolean just like that. 159 00:11:13,240 --> 00:11:19,690 And as I said Char I noticed that I did not explicitly tell them that I'm expecting a more f so if the 160 00:11:19,690 --> 00:11:26,860 person enters the word male or the word female then that will cause a problem because this is only expecting 161 00:11:27,130 --> 00:11:31,630 one character the one letter one one not a word. 162 00:11:31,630 --> 00:11:32,030 Right. 163 00:11:32,380 --> 00:11:37,830 So I'm going to be a bit more explicit with this prompt and I'm going to say m or f all right. 164 00:11:38,410 --> 00:11:44,620 So with all of that done no let's fix these conversion issues so it's the same thing we just have to 165 00:11:44,620 --> 00:11:52,750 see convert dots to double and there we have to double and then what are we converting work on inverting 166 00:11:53,050 --> 00:11:54,490 console dot redesign. 167 00:11:54,490 --> 00:11:56,650 So I opened the parentheses here. 168 00:11:56,650 --> 00:11:58,150 I need to make sure I close it. 169 00:11:58,180 --> 00:12:03,790 So this is a common error or open it's maybe we'll get up and go and get coffee and come back and then 170 00:12:03,850 --> 00:12:08,560 we look at it's one time I always say oh it's cool is because there's a close one but we're not paying 171 00:12:08,560 --> 00:12:15,100 attention right so it's always good to open and close in the seam sweep and then you can get distracted 172 00:12:15,100 --> 00:12:15,860 afterwards. 173 00:12:15,910 --> 00:12:17,840 That was spare a lot of heartache. 174 00:12:17,890 --> 00:12:19,590 So there we go. 175 00:12:19,610 --> 00:12:24,190 Bubble is sorry a seller is expecting a double. 176 00:12:24,220 --> 00:12:31,020 So we're getting the input from the console which is going us takes converting it to double. 177 00:12:31,030 --> 00:12:36,550 So whether or not it does this some other places it will treat it like it does and then it will put 178 00:12:36,550 --> 00:12:43,480 it in a W for char we have convert not to Cha. 179 00:12:43,480 --> 00:12:50,080 So you have a convert for almost every single data type that is in C sharp right. 180 00:12:50,080 --> 00:12:52,230 So you have quite a few data types. 181 00:12:52,350 --> 00:12:58,350 I have quite a few ways to convert them and I hope by now you realize that. 182 00:12:58,360 --> 00:13:02,050 Well I did see key symmetries when we were creating our projects. 183 00:13:02,150 --> 00:13:10,820 Well in the language itself keys does matter because if I write convert as a with a capital C that will 184 00:13:10,820 --> 00:13:16,610 never work because it doesn't know what converts with a common C sorry if I write convert with a common 185 00:13:16,610 --> 00:13:18,590 c it doesn't know what that is. 186 00:13:18,590 --> 00:13:27,410 So it only detects when I adhere to the strict rules and use my uppercase C for convert not console 187 00:13:27,440 --> 00:13:37,250 convert and then I say dot and then I have to boolean as an option and then I open parentheses and then 188 00:13:37,250 --> 00:13:39,880 I make sure to close my for and this is. 189 00:13:40,100 --> 00:13:48,470 And there we have our functions or our code our problems taking data and storing them into the different 190 00:13:48,470 --> 00:13:49,880 variables. 191 00:13:49,880 --> 00:13:58,480 No once I've done all of that I want to print this person's profile back to the screen so I'm going 192 00:13:58,480 --> 00:14:04,510 to do a little difference here with my printing to screen and we're going to call this concatenation. 193 00:14:04,510 --> 00:14:08,140 So this is the process of joining strings together. 194 00:14:08,140 --> 00:14:15,700 So earlier I would have had one console write that printed the static string and then another one to 195 00:14:15,700 --> 00:14:16,470 print the variable. 196 00:14:16,480 --> 00:14:22,270 This time I just want to write one console out right and I'm printing both the static String seeing 197 00:14:22,270 --> 00:14:27,250 your name is called on and then I'm putting the variable inside of that. 198 00:14:27,310 --> 00:14:29,810 So it gets printed automatically right. 199 00:14:30,160 --> 00:14:31,180 So there are many ways to do it. 200 00:14:31,180 --> 00:14:31,990 I'm to show you. 201 00:14:32,140 --> 00:14:37,060 Maybe the easiest way right now and as we go along I'll probably do it the other way so that we can 202 00:14:37,270 --> 00:14:39,610 get up and running. 203 00:14:39,730 --> 00:14:45,280 Actually I think we have enough data to print to look at all of the concatenation techniques so I'm 204 00:14:45,280 --> 00:14:47,320 just going to go through all of them. 205 00:14:47,380 --> 00:14:52,110 So I'm just going to write the first one. 206 00:14:52,110 --> 00:14:56,110 Sorry to print the name someone to C console. 207 00:14:56,160 --> 00:15:02,820 That's right open parentheses and I'll just put my semicolon there seemed fine. 208 00:15:02,850 --> 00:15:04,250 Everybody codes differently. 209 00:15:04,270 --> 00:15:06,160 I just like doing it at the same time. 210 00:15:06,280 --> 00:15:11,020 And then I went to say your name is colon. 211 00:15:11,290 --> 00:15:13,300 And then I can use a plus sign. 212 00:15:13,300 --> 00:15:16,240 So we all know that the plus sign is used in math right. 213 00:15:16,510 --> 00:15:21,820 Well when we're talking about strings and printing sentences or printing to the screen we can use the 214 00:15:21,820 --> 00:15:28,750 plus sign to say I want to add this block of text to whatever other block of the second of as many blocks 215 00:15:28,750 --> 00:15:32,770 of text as I want and plus signs in between. 216 00:15:32,800 --> 00:15:40,630 All right I can do that but in this situation what I want to add to this static block of text is the 217 00:15:40,630 --> 00:15:48,180 value that is inside names so I'm just going to say your name is static text plus name. 218 00:15:48,260 --> 00:15:49,930 So this is concatenation. 219 00:15:49,940 --> 00:15:53,090 So this will print one line seeing your name is. 220 00:15:53,090 --> 00:15:59,030 And whatever value was collected from the user at the time of input. 221 00:15:59,340 --> 00:15:59,680 All right. 222 00:16:00,080 --> 00:16:03,130 So I can just duplicate this or what. 223 00:16:03,140 --> 00:16:03,340 No. 224 00:16:03,350 --> 00:16:04,280 Let me write another one. 225 00:16:04,280 --> 00:16:16,500 So console not write and then this time I want to print your age so your age is cool on and then the 226 00:16:16,500 --> 00:16:24,720 next way I can concatenate is to use like placeholders and kind of have an array of variables to match 227 00:16:24,720 --> 00:16:25,620 these place holders. 228 00:16:25,620 --> 00:16:28,050 So I mean let me just demonstrate here. 229 00:16:28,080 --> 00:16:35,700 So I'm going to open curly brace use a placeholder and that's 0 and then is fairly obvious and then 230 00:16:35,700 --> 00:16:41,670 what is going to say is I know I'm need to print your name is and then I'm going to print this static 231 00:16:41,670 --> 00:16:48,180 text but then this as I said is acting as a placeholder so I need to define something that should be 232 00:16:48,180 --> 00:16:53,790 put into this space holder and what I do is after the block of text I press comma. 233 00:16:54,270 --> 00:17:00,900 And then I can insert a variable so the variable that I want to be inserted into the place holder is 234 00:17:01,170 --> 00:17:03,320 age all right. 235 00:17:03,480 --> 00:17:11,380 And then I'm going to print the salary to the screen so same treatments console. 236 00:17:11,850 --> 00:17:21,380 But right and then this time I'm going to do what we'll call interpolation. 237 00:17:21,410 --> 00:17:26,420 All right so this one I'm going to start off with a dollar sign at the start of the string so it's a 238 00:17:26,420 --> 00:17:27,080 dollar sign. 239 00:17:27,080 --> 00:17:37,740 Open and close quotation marks and then I want to see a dollar sign your salary is on and then interpolation 240 00:17:37,770 --> 00:17:43,560 allows me to just use open those braces and write the variable name right there inside of the static 241 00:17:43,560 --> 00:17:51,320 string so it is summary so I have one static string I just have to make sure I have the dollar sign 242 00:17:51,320 --> 00:17:56,070 it goes without the dollar sign then it will look more like the place or the code. 243 00:17:56,070 --> 00:17:56,490 All right. 244 00:17:56,500 --> 00:17:59,300 And that would not be desirable. 245 00:17:59,310 --> 00:18:04,920 So with the dollar sign instead of using a placeholder I'm just opening the curly brace and putting 246 00:18:04,920 --> 00:18:11,160 the variable itself inside of my contiguous string contiguous means continuous right. 247 00:18:11,430 --> 00:18:18,830 So all of this string is just one block and we have our variable being rendered inside of that. 248 00:18:18,840 --> 00:18:23,480 So the reason I'm showing all of these I can guarantee you this one will work. 249 00:18:23,910 --> 00:18:30,690 And this one will definitely work the based on the version of dot net framework that you're using and 250 00:18:30,840 --> 00:18:34,290 that influences the version of C sharp that you are using. 251 00:18:34,350 --> 00:18:37,950 You may or may not have access to the interpolation. 252 00:18:37,970 --> 00:18:38,190 Right. 253 00:18:38,190 --> 00:18:42,420 So as I said there are many ways to do it and it's good to understand and appreciate whole. 254 00:18:42,480 --> 00:18:48,530 But I can guarantee you if these two don't work this one definitely will. 255 00:18:48,570 --> 00:18:51,120 And if this one works this one definitely will. 256 00:18:51,120 --> 00:18:57,600 So you can pick you're about to pick whichever one you like the most and even more specifically whichever 257 00:18:57,600 --> 00:19:04,210 one actually works in your context some way to proceed with the simple one that I know works universally. 258 00:19:04,320 --> 00:19:09,990 And then I'm just going to make sure that I print the other two variables so this one says your gender 259 00:19:11,070 --> 00:19:18,440 is and then I'm printing gender and then the next one is are you working. 260 00:19:18,440 --> 00:19:26,000 Are you employed you are employed and we expect to see true or false. 261 00:19:26,000 --> 00:19:33,370 So then working all right now all of this is going to print what does one big block of text it's going 262 00:19:33,370 --> 00:19:36,100 to look disgusting on the screen which I'll show you why. 263 00:19:36,100 --> 00:19:37,480 So let's test it out. 264 00:19:37,480 --> 00:19:43,270 So my start project needs to be set of variables and data types so I write variables and data types 265 00:19:43,480 --> 00:19:48,280 set a start up project and then go ahead and start. 266 00:19:48,280 --> 00:19:55,180 All right so let's take our program for a test drive someone to say a test user is my name. 267 00:19:55,180 --> 00:19:57,120 I'm 22 years old. 268 00:19:57,220 --> 00:20:02,140 My salary is two thousand five hundred point thirty. 269 00:20:02,350 --> 00:20:08,680 Press enter my gender is m enter and my walk working. 270 00:20:08,710 --> 00:20:10,520 True I'm working. 271 00:20:10,650 --> 00:20:16,440 And then when I press enter you see that okay we just get one long line everything in one line those 272 00:20:16,440 --> 00:20:17,150 spaces. 273 00:20:17,170 --> 00:20:24,610 It's very difficult to read and that's because we wrote with console the right and not console right 274 00:20:24,750 --> 00:20:25,460 line. 275 00:20:25,520 --> 00:20:25,840 Right. 276 00:20:25,840 --> 00:20:31,070 So that's why we have to be very careful when we're using console rights and console that right line. 277 00:20:31,090 --> 00:20:39,890 So I'm just going to change this OS to console the right line and I can just copy and paste and do that 278 00:20:39,910 --> 00:20:46,880 mass replacement and then let's just run again and see how the old looks. 279 00:20:46,880 --> 00:20:55,790 So we start off with our name and then once the city's female user her age is 23 her salary is five 280 00:20:55,790 --> 00:20:57,590 thousand point four. 281 00:20:57,590 --> 00:21:02,220 It's our five thousand five hundred. 282 00:21:02,910 --> 00:21:07,550 Gender is F and then but then she's going to be unemployed. 283 00:21:07,550 --> 00:21:10,000 So working is falls. 284 00:21:10,040 --> 00:21:14,350 And then when we do that no we see the brindle looking much better. 285 00:21:14,420 --> 00:21:21,830 We have a line per bit of information or just we have our static text and then it is printing buck the 286 00:21:21,830 --> 00:21:22,680 value. 287 00:21:22,700 --> 00:21:23,270 All right. 288 00:21:23,360 --> 00:21:30,830 So the conversion was almost it really old and needed to be one way because noticed that a console is 289 00:21:30,830 --> 00:21:37,550 printing back the values we didn't have to convert from Char to string and we didn't have to do that 290 00:21:37,550 --> 00:21:40,140 to concatenate onto the string right. 291 00:21:40,160 --> 00:21:43,910 So it's strict in some aspects and it's flexible in some. 292 00:21:43,910 --> 00:21:49,880 So once again when we're collecting this string from the console we have to convert it into whatever 293 00:21:50,120 --> 00:21:55,070 e to type the variable that is receiving the data is all right. 294 00:21:55,070 --> 00:22:01,490 So to do int conversion to stored int w to store the W et cetera et cetera but then we were printing 295 00:22:01,490 --> 00:22:08,700 back to screen we didn't have to convert from that data type string to get it was attached to our string 296 00:22:08,720 --> 00:22:09,310 right. 297 00:22:09,320 --> 00:22:15,320 So everything when it's printing all day it will just contextually say OK yes I know this is a boolean 298 00:22:15,560 --> 00:22:16,800 but let me just print it.