I pretty new to C# programming so recently I was assigned to do a assignment to calculate the "AverageSpeed" and then match it against the "maxSpeed".

I have issue with the "maxSpeed" as no matter what value I key in I will get a "You are within the speed limit" where I know I should not have receive such a message. I suspect they are using the value of "maxSpeed" of 0 not the max speed in the case. 

The program is all about requesting the user for the driver name, the type of vehicle and the travel distance with duration in minutes to find out whether driver has exceed the maximum allowable speed.

Please advise.

```
private void btnSubmit_Click(object sender, EventArgs e)
{
    int minutes = Convert.ToInt32(txtDuration.Text);
    double miles = Convert.ToInt32(txtDistance.Text);
    double hours = minutes / 60;
    double AverageSpeed = GetMPH(hours, miles);

    Object itemSelect = (Object)cboCarType.SelectedItem;
    string carType = itemSelect.ToString();

    int maxSpeed =0;
    switch (carType)
    {
        case "Sedan":
            maxSpeed = 100;
            break;
        case "Wagon":
            maxSpeed = 90;
            MessageBox.Show("Wagon");
            break;
        case "Truck":
            maxSpeed = 50;
            break;
        case "Van":
            maxSpeed = 60;
            break;
        case "Bus":
            maxSpeed = 50;
            break;
        case "Tractor trailer":
            maxSpeed = 30;
            break;
    }

    if (AverageSpeed > maxSpeed)
    {
        MessageBox.Show("You have exceed the maximun speed!");
    }
    else
    {
        MessageBox.Show("You are within the speed limit!");
    }

}

double GetMPH(double miles, double hours) 
{
    double GetMPH = miles / hours;
    return GetMPH;
}

```