Tekil Mesaj gösterimi
C# ta yazılmış hesap makinesi
Alt
  (#1)
arcger is Offline
[10]Yeni Üye
 
arcger - ait Kullanıcı Resmi (Avatar)
 
Mesaj Sayısı: 18
Açtığı Konu: 1

Level: 2 [♥ Bé-Yêu ♥♥ Bé-Yêu ♥]
Paylaşım: 0 / 49
Güç: 6 / 249
Tecrübe: 97%

Üyelik tarihi: Apr 2007
Kullanıcı No: 700
Tecrübe Puanı: 24
REP Puanı : 100
REP Seviyesi : arcger will become famous soon enougharcger will become famous soon enough
   
Standart C# ta yazılmış hesap makinesi - 05-05-2007


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

namespace WindowsApplication5
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public double a,b,c,x;
public string islem;
private void tut()
{
a = double.Parse(textBox1.Text);
textBox1.Text = "";
}

private void c_sıfırla_Click(object sender, EventArgs e)
{
this.textBox1.Text = string.Empty;
}

private void button1_Click(object sender, EventArgs e)
{
ActiveForm.Close();
}

private void Form1_Load(object sender, EventArgs e)
{

}

private void btn_0_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "0";
}

private void btn_00_Click(object sender, EventArgs e)
{
textBox1.Text =textBox1.Text + "00";
}

private void btn_1_Click(object sender, EventArgs e)
{
textBox1.Text =textBox1.Text + "1";
}


private void btn_2_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "2";
}

private void btn_3_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "3";
}

private void btn_4_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "4";
}

private void btn_5_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "5";
}

private void btn_6_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "6";
}

private void btn_7_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "7";
}

private void btn_8_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + 8;
}

private void btn_9_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + 9;
}

private void btn_esittir_Click(object sender, EventArgs e)
{

b = Double.Parse(textBox1.Text);
textBox1.Text = "";
double c= 0 ;
switch (islem)
{
case "+":
c = a + b;
break;
case "-":
c = a - b;
break;
case "*":
c = a * b;
break;
case "/":
c = a /b;
break;
case "usal":
c = Math.Pow(a , b);
break;
case "kokal":
c = Math.Pow(a, (1 / b));
break;
}
textBox1.Text = c.ToString();


}

private void btn_topla_Click(object sender, EventArgs e)
{
tut();
islem = "+";

}

private void btn_cikar_Click(object sender, EventArgs e)
{
tut();
islem = "-";
}

private void btn_carp_Click(object sender, EventArgs e)
{
tut();
islem = "*";
}

private void btn_bol_Click(object sender, EventArgs e)
{
tut();
islem = "/";
}

private void btn_kokal_Click(object sender, EventArgs e)
{
tut();
islem = "kokal";
}

private void btn_usal_Click(object sender, EventArgs e)
{
tut();
islem = "usal";

}


}

}
bu da kullanıcı arayüzü

  
Alıntı ile Cevapla