private void ButtonCalculate_Click(object sender, RoutedEventArgs e)
        {
            Mileage m = new Mileage();
            //inputs
            m.Distance = double.Parse(textMiles.Text);
            m.Gallons = double.Parse(textGallons.Text);
            m.PricePerGallon = double.Parse(textPrice.Text);
            //outputs
            labelMileage.Content = m.CalculateMileage().ToString();
            labelCost.Content = m.CalculatePricePerMile().ToString();

        }
Esempio n. 2
0
        private void ButtonCalculate_Click(object sender, RoutedEventArgs e)
        {
            Mileage m = new Mileage();

            //inputs
            m.Distance       = double.Parse(textMiles.Text);
            m.Gallons        = double.Parse(textGallons.Text);
            m.PricePerGallon = double.Parse(textPrice.Text);
            //outputs
            labelMileage.Content = m.CalculateMileage().ToString();
            labelCost.Content    = m.CalculatePricePerMile().ToString();
        }