(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 total distance traveled
and the total hours traveled
and that will be multiplied by the time to get from NY city to MIAMI to get the distance from NY city to MIAMI.
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 double void
and declare them public or private?
4 Textboxes:
Starting Mileage
Ending Mileage
Total Driving Time
Time from NY city to MIAMI
I have placed my functions which will be executed by a button click. A brief Idea of how I plan to use the functions:
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();
}