21 Aralık 2013 Cumartesi

C # PROGRAMI İLE ÖRNEK SORULAR

BEDEN KİTLE İNDEKSİ HESAPLAMA PROGRAMI


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

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

        private void button1_Click(object sender, EventArgs e)
        {
            double boy, kilo,bki;
            boy = Convert.ToDouble(textBox1.Text);
            kilo = Convert.ToDouble(textBox2.Text);
            bki=kilo/(boy*boy);
            if (bki >= 50)
            {
                MessageBox.Show("ÖLÜMCÜL");
            }
            else if (bki >=45 && bki <49.9)
            {
                MessageBox.Show("AŞIRI OBEZ");
            }
            else if (bki >= 35 && bki < 44.9)
            {
                MessageBox.Show(" OBEZ");
            }
            else if (bki >= 30 && bki < 34.9)
            {
                MessageBox.Show("NORMAL");
            }
            else if (bki >= 25 && bki < 29.9)
            {
                MessageBox.Show("HAFİF ŞİŞMAN");
            }
            else if (bki >= 20 && bki < 24.9)
            {
                MessageBox.Show("ZAYIF");
            }
        }
    }

}

Hiç yorum yok: