Fall 2024 - CS411 - 2 - BC230203930
Fall 2024 - CS411 - 2 - BC230203930
Output Screenshot:
XAML CODE:
<Window x:Class="BC230203930.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:BC230203930"
mc:Ignorable="d"
Title="BMI Calculator" Height="275" Width="400" Background="#EAD5E8">
<Grid>
C# Code:
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace BC230203930
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
try
{
double weight = double.Parse(txtWeight.Text);
double height = double.Parse(txtHeight.Text);