CS411 Assignment 2 Solution FALL 2024 by Learning with Miss Khattak || CS411 assignment 2 solution

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 พ.ย. 2024

ความคิดเห็น • 11

  • @Ayesha-gd4lw
    @Ayesha-gd4lw 6 วันที่ผ่านมา

    MAM CODE DY DAIN...

    • @learningwithmisskhattak
      @learningwithmisskhattak  6 วันที่ผ่านมา +1

      //Put your XAML code (code of the MainWindow.xaml file) here











      //Put your C# code (code of the MainWindow.xaml.cs file) here
      using System;
      using System.Windows;
      namespace CS411_2_Fall2024
      {
      public partial class MainWindow : Window
      {
      public MainWindow()
      {
      InitializeComponent();
      }
      private void btnCalculate_Click(object sender, RoutedEventArgs e)
      {
      try
      {
      // Validate input
      if (string.IsNullOrWhiteSpace(txtHeight.Text) || string.IsNullOrWhiteSpace(txtWeight.Text))
      {
      MessageBox.Show("Please enter both height and weight.", "Input Error",
      MessageBoxButton.OK, MessageBoxImage.Warning);
      return;
      }
      // Parse height and weight
      double height = double.Parse(txtHeight.Text);
      double weight = double.Parse(txtWeight.Text);
      // Height conversion and BMI calculation
      height = height / 100; // Convert to meters
      double bmi = weight / (height * height);
      // Display rounded BMI
      txtBMI.Text = Math.Round(bmi, 2).ToString();
      }
      catch (FormatException)
      {
      MessageBox.Show("Please enter valid numeric values for height and weight.", "Format Error",
      MessageBoxButton.OK, MessageBoxImage.Error);
      }
      catch (Exception ex)
      {
      MessageBox.Show($"An unexpected error occurred: {ex.Message}", "Error",
      MessageBoxButton.OK, MessageBoxImage.Error);
      }
      }
      }
      }

  • @ABDULQADEER-g5m
    @ABDULQADEER-g5m 6 วันที่ผ่านมา

    thanks dear your the best

  • @Ayesha-gd4lw
    @Ayesha-gd4lw 6 วันที่ผ่านมา

    great effort

    • @learningwithmisskhattak
      @learningwithmisskhattak  6 วันที่ผ่านมา +1

      thanks

    • @Ayesha-gd4lw
      @Ayesha-gd4lw 6 วันที่ผ่านมา +1

      @@learningwithmisskhattak mam code plz

    • @learningwithmisskhattak
      @learningwithmisskhattak  6 วันที่ผ่านมา +1

      //Put your XAML code (code of the MainWindow.xaml file) here











      //Put your C# code (code of the MainWindow.xaml.cs file) here
      using System;
      using System.Windows;
      namespace CS411_2_Fall2024
      {
      public partial class MainWindow : Window
      {
      public MainWindow()
      {
      InitializeComponent();
      }
      private void btnCalculate_Click(object sender, RoutedEventArgs e)
      {
      try
      {
      // Validate input
      if (string.IsNullOrWhiteSpace(txtHeight.Text) || string.IsNullOrWhiteSpace(txtWeight.Text))
      {
      MessageBox.Show("Please enter both height and weight.", "Input Error",
      MessageBoxButton.OK, MessageBoxImage.Warning);
      return;
      }
      // Parse height and weight
      double height = double.Parse(txtHeight.Text);
      double weight = double.Parse(txtWeight.Text);
      // Height conversion and BMI calculation
      height = height / 100; // Convert to meters
      double bmi = weight / (height * height);
      // Display rounded BMI
      txtBMI.Text = Math.Round(bmi, 2).ToString();
      }
      catch (FormatException)
      {
      MessageBox.Show("Please enter valid numeric values for height and weight.", "Format Error",
      MessageBoxButton.OK, MessageBoxImage.Error);
      }
      catch (Exception ex)
      {
      MessageBox.Show($"An unexpected error occurred: {ex.Message}", "Error",
      MessageBoxButton.OK, MessageBoxImage.Error);
      }
      }
      }
      }

  • @Ayesha-gd4lw
    @Ayesha-gd4lw 6 วันที่ผ่านมา +1

    mam video bohat achi hai but plz music na lgaya kryn is tarah achy sy awaaz ka pta nai chlta

  • @kashifishfaq5277
    @kashifishfaq5277 6 วันที่ผ่านมา

    mam Mara yh wpf mara ni show ho rha