Hello world I'm talking about using void functions in C sharp. I have a. Program that I wrote earlier To select inches and Display it as feet and inches. And the scrollbar, horizontal scrollbar, is called hsbInches. And then we have lblInches. And with a starting value of 0'0". It's really important that you don't have things like label1 Nonsense words that come up when the program starts. And we have added to that program Another scroll bar called hsbPounds to select the weight. I'm going to run this just to show you What I want this program to do, and then we'll talk about how to write that. So let me run this. This is where we are now. I can select a height. And as I move the thumb along the height changes. And if I move this one. label for the weight changes also. But I have a label for the BMI (Body Mass Index), but I haven't added the code for that. I don't have any button to do the calculation but I would like to happen is this when you change this. Or this one. We calculate and display the BMI. Let's go in and take a look at what code we have so far. I start off with a comment. And I have the formula I'm going to use. It's 703 * the pounds divided by inches squared with we're going to write as inches * inches. Scroll down. You can see for when the. Inches scrollbar. changes, We calculate. the feet By dividing an integer by 12 that will give us an integer value. And then the inches, Use that to get the remainder using the % 12 and then I have some code here: start with a null string. And the value of feet. I have just a single quote. And then I have. the value of inches plus Backsplash with a double quote, \" escapes that so it will display something like 5'3". And for the pounds, I just display it right now. I'm going to add Another function, This is not responding to an event: this is a stand-alone, if you will. private And it is going to be void. calculate BMI stands for body mass index and we have the parentheses, but there is there are no Parameters. Like there are for a function that's responding to an event, but even though it's empty we still need those. And then the curly braces. This is where I'm going to calculate the BMI. And if we are dividing by inches times inches and inches is 0, we will have a divide by zero error that will occur. So we are going to have to watch out for that. I'm going to declare a couple of variables here. It makes it just a little bit easier, I can use this formula then. And what I'm going to say. if Inches is greater than 0. I'm going to do this calculation. Okay. So I'm going to have this formula. int BMI is equal to 703. times pounds divided by (inches * inches) which is inches squared. And then I'm going to display that. In my label. And we have to assign. a string to text, and I can do that either by taking a null string Adding BMI to that, Or I can use the toString. method. Now. The next thing I need to do is to call this function. And we're going to call it when either of these scroll bars changes. [Move up to this one.] Also here. Semicolon. And let's run it and see where we are. So I can select. a height And a weight. The BMI Displays and I don't need any button. I'm using this void function, a general function that isn't responding to any of event But is called each time either one of the scrollbars changes. This is really important that we don't have the same code in two places. I don't want to do all the calculations here and then do all the calculations for pounds. And if I were dedugging it, I might have thought I had changed it, and I had only changed it in one place, not both. So you never want to have a bunch of statements in two places. So, we avoid that by putting it all into this. Void function that's a general-purpose one. And that's it!