title: C# Functions inside a button click for calculating distance
body: <p>(I have been newly introduced to the world of C# coding.) I am currently trying to work with the use of functions in the C# language. The program goal is to try to calculate the average using the <code>total distance traveled</code> and the <code>total hours traveled</code> and that will be multiplied by the time to get from NY city to MIAMI to get the distance from NY city to MIAMI. </p>
  
  <p>How can i buld the functions(content wise) properly to give me the result(distance from NY city to MIAMI)? Should i make the function <code>double void</code> and declare them public or private?</p>
  
  <p>4  Textboxes:</p>
  
  <pre><code>Starting Mileage
  Ending Mileage
  Total Driving Time 
  Time from NY city to MIAMI
  </code></pre>
  
  <p>I have placed my functions which will be executed by a button click.  A brief Idea of how I plan to use the functions:</p>
  
  <pre><code> private void button1_Click(object sender, EventArgs e)
          {
              double v = Calculate_Velocity();
              double t = Get_Time();
              double d = Calculate_Distance (v,t);
              Display_Results(v, t, d);
              Clear_TextBoxes();
  
  
          }
  </code></pre>