C# Radio Button İle KDV Hesaplama - Bilişim Konuları

C# Radio Button İle KDV Hesaplama

Bu örneğimizde herhangi bir ürünün belirlenen adedinin birim fiyat ile çarpılmasıyla toplam fiyatını hesaplatacağız. Daha sonra elde edile toplam fiyat üzerinden belirlenen oranda KDV hesaplaması yapacağız. KDV ile toplam fiyatı birleştirerek ürünün fiyatını hesaplatacağız. Bu işlemi de radio button nesnesi yardımıyla yapacağız.

Programın ekran görüntüsü:

kdvhesaplama




Programın 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

<< Önceki Yazı

Yorum Yap

1 Yorum