using System;
using System.Windows.Forms;

namespace _8_3
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            comboBox1.DropDownStyle = ComboBoxStyle.DropDownList;
            comboBox1.Items.AddRange(new object[] { "*", "+", "/", "-" });
        }

        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                double x, y;

                // خواندن عملوندها از ورودی
                x = Convert.ToDouble(textBox1.Text);
                y = Convert.ToDouble(textBox2.Text);

                switch (comboBox1.SelectedIndex)
                {
                    case 0:
                        MessageBox.Show("جواب: " + (x * y).ToString());
                        break;
                    case 1:
                        MessageBox.Show("جواب: " + (x + y).ToString());
                        break;
                    case 2:
                        MessageBox.Show("جواب: " + (x / y).ToString());
                        break;
                    case 3:
                        MessageBox.Show("جواب: " + (x - y).ToString());
                        break;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
    }
}