c# da hesap makinası kodları

Latın1

Katılımcı Üye
23 Nis 2010
818
0
VisuaL Basic & Cs5
gerekli olanlar ;
22 adet button
1 adet textbox


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

namespace hesapmakinesi
{
public partial class Form1 : Form
{
double tamsayi, sonuc = 0;
float ondalik = 0;
bool sifirla = true;
string islem = "yok";
public Form1()
{
InitializeComponent();

}

private **** dortislem()
{
if (!sifirla)
{
switch (islem)
{
case "esittir":
sonuc = Convert.ToDouble(txtAlan.Text);
break;
case "carpma":
sonuc *= Convert.ToSingle(txtAlan.Text);
break;
case "toplama":
sonuc += Convert.ToSingle(txtAlan.Text);
break;
case "cikarma":
sonuc -= Convert.ToSingle(txtAlan.Text);
break;
case "bolme":
sonuc /= Convert.ToSingle(txtAlan.Text);
break;
case "yok":
sonuc = Convert.ToSingle(txtAlan.Text);
break;
}

txtAlan.Text = Convert.ToString(sonuc);
sifirla = true;
}

}
private **** tekislem()
{
if (!sifirla)
{
switch (islem)
{

}
}
}
private **** button8_Click(object sender, EventArgs e)
{
if (!sifirla)
{
txtAlan.Text += "8";
}
else
{
txtAlan.Text = "8";
}
sifirla = false;
}

private **** label1_Click(object sender, EventArgs e)
{

}

private **** Form1_Load(object sender, EventArgs e)
{

}

private **** button5_Click(object sender, EventArgs e)
{
if (!sifirla)
{
txtAlan.Text += "5";
}
else
{
txtAlan.Text = "5";
}
sifirla = false;
}

private **** button10_Click(object sender, EventArgs e)
{
if (!sifirla)
{
if (txtAlan.Text != "0")
{
txtAlan.Text += "0";
sifirla = false;
}
else
{
txtAlan.Text = "0";
sifirla = true;
}
}
else { txtAlan.Text = "0"; }
}

private **** button1_Click(object sender, EventArgs e)
{
if (!sifirla)
{
txtAlan.Text += "1";
}
else
{
txtAlan.Text = "1";
}
sifirla = false;

}

private **** button2_Click(object sender, EventArgs e)
{

if (!sifirla)
{
txtAlan.Text += "2";
}
else
{
txtAlan.Text = "2";
}
sifirla = false;
}

private **** button3_Click(object sender, EventArgs e)
{
if (!sifirla)
{
txtAlan.Text += "3";
}
else
{
txtAlan.Text = "3";
}
sifirla = false;
}

private **** button4_Click(object sender, EventArgs e)
{
if (!sifirla)
{
txtAlan.Text += "4";
}
else
{
txtAlan.Text = "4";
}
sifirla = false;
}

private **** button6_Click(object sender, EventArgs e)
{
if (!sifirla)
{
txtAlan.Text += "6";
}
else
{
txtAlan.Text = "6";
}
sifirla = false;
}

private **** button7_Click(object sender, EventArgs e)
{
if (!sifirla)
{
txtAlan.Text += "7";
}
else
{
txtAlan.Text = "7";
}
sifirla = false;
}

private **** button9_Click(object sender, EventArgs e)
{
if (!sifirla)
{
txtAlan.Text += "9";
}
else
{
txtAlan.Text = "9";
}
sifirla = false;
}

private **** button13_Click(object sender, EventArgs e)
{
dortislem();
islem = "toplama";

}

private **** button14_Click(object sender, EventArgs e)
{
dortislem();
islem = "cikarma";
}

private **** button15_Click(object sender, EventArgs e)
{
dortislem();
islem = "carpma";
}

private **** button16_Click(object sender, EventArgs e)
{
dortislem();
islem = "bolme";
}

private **** button21_Click(object sender, EventArgs e)
{
txtAlan.Clear();
txtAlan.Text = "0";
sonuc = 0;
islem="yok";
sifirla= true;
}

private **** button22_Click(object sender, EventArgs e)
{
Close();
}

private **** button17_Click(object sender, EventArgs e)
{
dortislem();
islem = "esittir";
}

private **** button20_Click(object sender, EventArgs e)
{
double a;
dortislem();
sonuc = Convert.ToInt32(txtAlan.Text);
a = Math.Sqrt(sonuc);
txtAlan.Text = Convert.ToString(a);

}

private **** button18_Click(object sender, EventArgs e)
{
dortislem();
sonuc = 1 / sonuc;
txtAlan.Text = Convert.ToString(sonuc);
islem = "1bolux";
}

private **** textBox1_TextChanged(object sender, EventArgs e)
{

}

private **** button19_Click(object sender, EventArgs e)
{

}

private **** button12_Click(object sender, EventArgs e)
{
dortislem();
sonuc = 0 - sonuc;
txtAlan.Text = Convert.ToString(sonuc);
islem = "artieksi";
}

private **** button11_Click(object sender, EventArgs e)
{
if (!sifirla)
{
txtAlan.Text += ",";
}
else
{
txtAlan.Text = ",";
}
sifirla = false;
}
}
}
 

Latın1

Katılımcı Üye
23 Nis 2010
818
0
VisuaL Basic & Cs5
arkadaşlar bakıyorsunuz yorum yapın veya teşekkür butonuna basında hata varmı ek eklenti isteğiniz varmı bende ona göre size cevap veririm ?
 

relocks008

Yeni üye
25 Ocak 2012
3
0
Kardeş bu program çok uzun buyur.Console application tarzında benim hesap makinem visual 2010da yaptım.
buyur:



using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication3
{
class Program
{

static **** Main(string[] args)
{
int sayi1, sayi2;

string sayistr1, sayistr2, islem;

Console.Clear();

Console.BackgroundColor = ConsoleColor.DarkBlue;

Console.ForegroundColor = ConsoleColor.Yellow;

Console.Clear();

Console.Write("1. sayıyı giriniz:");

sayistr1 = Console.ReadLine();

Console.Write("2. sayıyı giriniz:");

sayistr2 = Console.ReadLine();
sayi1 = Int32.Parse(sayistr1);
sayi2 = Int32.Parse(sayistr2);
Console.Clear();
Console.WriteLine("işlem seçiniz");
Console.WriteLine("(1) Toplama");
Console.WriteLine("(2) Çıkarma");
Console.WriteLine("(3) Çarpma");
Console.WriteLine("(4) Bölme");
Console.WriteLine("(5) Kalan");
Console.WriteLine("(6) Karesi");
Console.WriteLine("Seçiminiz nedir? :");
islem = Console.ReadLine();
Console.Clear();
Console.WriteLine("|--------------------------------------------------------|");
if (islem == "1") Console.WriteLine("|-----------------------{0} + {1}= {2}-------------------------|", sayi1, sayi2, (sayi1 + sayi2));
if (islem == "2") Console.WriteLine("|-----------------------{0} – {1}= {2}-------------------------|", sayi1, sayi2, (sayi1 - sayi2));
if (islem == "3") Console.WriteLine("|----------------------{0} * {1}= {2}----------------------|", sayi1, sayi2, (sayi1 * sayi2));
if (islem == "4") Console.WriteLine("|---------------- -------{0} / {1}= {2}--- ----------------------|", sayi1, sayi2, (sayi1 / sayi2));
if (islem == "5") Console.WriteLine("|-----------------------{0} % {1}= {2}-------------------------|", sayi1, sayi2, (sayi1 % sayi2));
if (islem == "6") Console.WriteLine("|----------------------{0} * {1} = {2}---------------------|", sayi1, sayi1, (sayi1 * sayi1));
Console.WriteLine("|--------------------------------------------------------|");
Console.WriteLine(" BaRıŞ UySaLLL...");
Console.WriteLine("|--------------------------------------------------------|");
Console.ReadLine();
}
}
}
 
Üst

Turkhackteam.org internet sitesi 5651 sayılı kanun’un 2. maddesinin 1. fıkrasının m) bendi ile aynı kanunun 5. maddesi kapsamında "Yer Sağlayıcı" konumundadır. İçerikler ön onay olmaksızın tamamen kullanıcılar tarafından oluşturulmaktadır. Turkhackteam.org; Yer sağlayıcı olarak, kullanıcılar tarafından oluşturulan içeriği ya da hukuka aykırı paylaşımı kontrol etmekle ya da araştırmakla yükümlü değildir. Türkhackteam saldırı timleri Türk sitelerine hiçbir zararlı faaliyette bulunmaz. Türkhackteam üyelerinin yaptığı bireysel hack faaliyetlerinden Türkhackteam sorumlu değildir. Sitelerinize Türkhackteam ismi kullanılarak hack faaliyetinde bulunulursa, site-sunucu erişim loglarından bu faaliyeti gerçekleştiren ip adresini tespit edip diğer kanıtlarla birlikte savcılığa suç duyurusunda bulununuz.