Visual C# Radiobuton İle KDV Hesaplama - Bilişim Konuları

Visual C# Radiobuton İle KDV Hesaplama

Bu makalede Kdv hesaplama programı yaptık. Visual C# programında öncelikle ürün fiyatı girilmektedir. Daha sonra o üründen kaç adet olduğu girildikten sonra ekranda bulunan 3 tane KDV oranından bir tanesi seçilmesi gerekiyor. Kdv oranı seçildikten sonra hesapla butonuna tıklanınca hem kdv tutarını hem de toplam tutarı hesaplayarak ekrandaki ilgili yerlere yazdırıyor.

Programın Visual C# kodları:

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

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

        private void button1_Click(object sender, EventArgs e)
        {
            double ufiyati, adedi, kdv=0,tutar, ttutar;
            ufiyati = Convert.ToDouble(textBox1.Text);
            adedi = Convert.ToDouble(textBox2.Text);
            tutar=ufiyati*adedi;

            if (radioButton1.Checked)
            {
                kdv = tutar * 0.01;
            }
            if (radioButton2.Checked)
            {
                kdv = tutar * 0.08;
            }
            if (radioButton3.Checked)
            {
                kdv = tutar * 0.18;
            }
            ttutar = tutar + kdv;
            textBox3.Text = kdv.ToString();
            textBox4.Text = ttutar.ToString();
        }

        private void radioButton1_CheckedChanged(object sender, EventArgs e)
        {

        }
    }
}
Bu Yazıya Tepkin Nedir?
+1
1
+1
0
+1
0
+1
0
+1
0
+1
0
+1
0

Yorum Yap