aaa_akreps
New member
- Katılım
- 16 Tem 2009
- Mesajlar
- 1
- Reaction score
- 0
- Puanları
- 0
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class hesapla : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.CacheControl = "no-cache";
// Response.Cache.SetCacheability(HttpCacheability.NoCache);
LblHata.Text = "";
if (!IsPostBack)
{
hfsayi2.Value = "0";
}
}
public void us(double x , double y)
{
double ust;
ust= Math.Pow(x,y);
txtsonuc.Text = ust.ToString();
}
public void topla(double x, double y)
{
double toplam;
toplam=x+y;
txtsonuc.Text=toplam.ToString();
}
public void cikart(double x, double y)
{
double cikar;
cikar = x - y;
txtsonuc.Text = cikar.ToString();
}
public void bolme(double x, double y)
{
double bol;
bol = x / y;
txtsonuc.Text = bol.ToString();
}
public void carpma(double x, double y)
{
double carp;
carp = x * y;
txtsonuc.Text = carp.ToString();
}
protected void btnyedi_Click(object sender, EventArgs e)
{
btnyedi.Text = "7";
txtsonuc.Text += btnyedi.Text;
}
protected void btnsekiz_Click(object sender, EventArgs e)
{
btnsekiz.Text = "8";
txtsonuc.Text += btnsekiz.Text;
protected void btndokuz_Click(object sender, EventArgs e)
{
btndokuz.Text = "9";
txtsonuc.Text += btndokuz.Text;
}
protected void btndort_Click(object sender, EventArgs e)
{
btndort.Text = "4";
txtsonuc.Text += btndort.Text;
}
protected void btnbes_Click(object sender, EventArgs e)
{
btnbes.Text = "5";
txtsonuc.Text += btnbes.Text;
}
protected void btnalti_Click(object sender, EventArgs e)
{
btnalti.Text = "6";
txtsonuc.Text += btnalti.Text;
}
protected void btnbir_Click(object sender, EventArgs e)
{
btnbir.Text = "1";
txtsonuc.Text += btnbir.Text;
}
protected void btniki_Click(object sender, EventArgs e)
{
btniki.Text = "2";
txtsonuc.Text += btniki.Text;
}
protected void btnuc_Click(object sender, EventArgs e)
{
btnuc.Text = "3";
txtsonuc.Text += btnuc.Text;
}
protected void btntopla_Click(object sender, EventArgs e)
{
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
lstgoster.Items.Add(txtsonuc.Text + " + ");
//double sayi1, sayi2, sayi3;
hfsayi1.Value = txtsonuc.Text;
txtsonuc.Text = "";
btncarp.CommandArgument = "0";
btncikar.CommandArgument = "0";
btnbol.CommandArgument = "0";
btntopla.CommandArgument = "1";
}
protected void btncikar_Click(object sender, EventArgs e)
{
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
lstgoster.Items.Add(txtsonuc.Text + " - ");
//double sayi1, sayi2, sayi3;
hfsayi1.Value = txtsonuc.Text;
txtsonuc.Text = "";
btncarp.CommandArgument = "0";
btncikar.CommandArgument = "1";
btnbol.CommandArgument = "0";
btncarp.CommandArgument = "0";
}
protected void btnbol_Click(object sender, EventArgs e)
{
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
lstgoster.Items.Add(txtsonuc.Text + " / ");
//double sayi1, sayi2, sayi3;
hfsayi1.Value = txtsonuc.Text;
txtsonuc.Text = "";
btncarp.CommandArgument = "0";
btncikar.CommandArgument = "0";
btnbol.CommandArgument = "1";
btntopla.CommandArgument = "0";
}
protected void btncarp_Click(object sender, EventArgs e)
{
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
lstgoster.Items.Add(txtsonuc.Text + " * ");
//double sayi1, sayi2, sayi3;
hfsayi1.Value = txtsonuc.Text;
txtsonuc.Text = "";
btncarp.CommandArgument = "1";
btncikar.CommandArgument = "0";
btnbol.CommandArgument = "0";
btntopla.CommandArgument = "0";
}
protected void btneksiarti_Click(object sender, EventArgs e)
{
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
if (txtsonuc.Text.Substring(0, 1) != "-")
txtsonuc.Text = "-" + txtsonuc.Text;
else
txtsonuc.Text = txtsonuc.Text.Substring(1);
}
protected void Btnesit_Click(object sender, EventArgs e)
{
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
if (btnbol.CommandArgument == "1" && txtsonuc.Text == "0")
{
LblHata.Text = " Sayı / 0 Tanımsızdır işlem yapılamaz";
return;
}
string deger=lstgoster.Items[lstgoster.Items.Count-1].Text;
deger+=txtsonuc.Text;
if(btncarp.CommandArgument=="1")
carpma(double.Parse(hfsayi1.Value), double.Parse(txtsonuc.Text));
if (btncikar.CommandArgument == "1")
cikart(double.Parse(hfsayi1.Value), double.Parse(txtsonuc.Text));
if (btntopla.CommandArgument == "1")
topla(double.Parse(hfsayi1.Value), double.Parse(txtsonuc.Text));
if (btnbol.CommandArgument == "1")
bolme(double.Parse(hfsayi1.Value), double.Parse(txtsonuc.Text));
if (btnus.CommandArgument == "1")
us(double.Parse(hfsayi3.Value), double.Parse(txtsonuc.Text));
lstgoster.Items[lstgoster.Items.Count - 1].Text = deger + "=" + txtsonuc.Text;
//lstgoster.Items.Add("=" + txtsonuc.Text);
return;
}
protected void btntemizle_Click(object sender, EventArgs e)
{
txtsonuc.Text = "";
}
protected void btnnokta_Click(object sender, EventArgs e)
{
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
txtsonuc.Text += ".";
}
protected void Button1_Click(object sender, EventArgs e)
{
Button1.Text = "0";
txtsonuc.Text += Button1.Text;
}
protected void btnmc_Click(object sender, EventArgs e)
{
if (txtsonuc.Text.Length==0)
{
LblHata.Text = "Değer Girilmeden işlem yapılmaz";
return;
}
txthafiza.Text = "";
hfsayi2.Value = "0";
}
protected void btnmarti_Click(object sender, EventArgs e)
{
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
double sayi1;
if (txtsonuc.Text != "")
{
sayi1 = Convert.ToDouble(hfsayi2.Value) + Convert.ToDouble(txtsonuc.Text);
hfsayi2.Value = sayi1.ToString();
txthafiza.Text = "M="+hfsayi2.Value;
txtsonuc.Text = "";
}
}
protected void btnmr_Click(object sender, EventArgs e)
{
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
txtsonuc.Text = hfsayi2.Value;
}
protected void btnmeksi_Click(object sender, EventArgs e)
{
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
double sayi1;
//hfsayi2.Value = txtsonuc.Text;
sayi1 = Convert.ToDouble(hfsayi2.Value) - Convert.ToDouble(txtsonuc.Text);
hfsayi2.Value = sayi1.ToString();
txthafiza.Text = "M=" + hfsayi2.Value;
txtsonuc.Text = "";
}
protected void Button2_Click(object sender, EventArgs e)
{
lstgoster.Items.Clear();
hfsayi1.Value = "";
hfsayi2.Value = "";
txtsonuc.Text = "";
txthafiza.Text = "";
}
protected void btnsin_Click(object sender, EventArgs e)
{
string deger = txtsonuc.Text;
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
double a,b;
a =Convert.ToDouble(txtsonuc.Text);
b = Convert.ToDouble(Math.Sin(a * Math.PI / 180));
lstgoster.Items.Add("sin(" + deger + ")=" +b.ToString("#,##0.00"));
}
protected void btntan_Click(object sender, EventArgs e)
{
string deger = txtsonuc.Text;
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
double a, b;
a = Convert.ToDouble(txtsonuc.Text);
b = Convert.ToDouble(Math.Tan(a * Math.PI / 180));
txtsonuc.Text = b.ToString("#,##0.00");
lstgoster.Items.Add("tan(" + deger + ")=" + b.ToString("#,##0.00"));
}
protected void btncos_Click(object sender, EventArgs e)
{
string deger = txtsonuc.Text;
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
double a, b;
a = Convert.ToDouble(txtsonuc.Text);
b = Convert.ToDouble(Math.Cos (a * Math.PI / 180));
txtsonuc.Text = b.ToString("#,##0.00");
lstgoster.Items.Add("cos(" + deger + ")=" + b.ToString("#,##0.00"));
}
protected void btncot_Click(object sender, EventArgs e)
{
string deger = txtsonuc.Text;
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
if (txtsonuc.Text == "0")
{
LblHata.Text = "işlem yapılamaz";
return;
}
double sin,con,cot,a,b;
a = Convert.ToDouble(txtsonuc.Text);
sin = Convert.ToDouble(Math.Sin(a * Math.PI / 180));
b = Convert.ToDouble(txtsonuc.Text);
con = Convert.ToDouble(Math.Cos(a * Math.PI / 180));
cot = con / sin;
lstgoster.Items.Add("cot(" + deger + ")=" + cot.ToString("#,##0.00"));
}
protected void btnasin_Click(object sender, EventArgs e)
{
string deger = txtsonuc.Text;
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
double a, b;
a = Convert.ToDouble(txtsonuc.Text);
b = Convert.ToDouble(Math.Asin(a * Math.PI / 180));
if ( b > -Math.PI && b< Math.PI)
{
lstgoster.Items.Add("A_sin(" + deger + ")=" + b.ToString("#,##0.00"));
}
else
LblHata.Text = "Tanımlı aralıkta değil";
txtsonuc.Text = "";
return;
protected void btnatan_Click(object sender, EventArgs e)
{
string deger = txtsonuc.Text;
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
double a, b;
a = Convert.ToDouble(txtsonuc.Text);
b = Convert.ToDouble(Math.Atan(a * Math.PI / 180));
if (b > -Math.PI && b < Math.PI)
{
lstgoster.Items.Add("A_tan(" + deger + ")=" + b.ToString("#,##0.00"));
}
else
LblHata.Text = "Tanımlı aralıkta değil";
txtsonuc.Text = "";
return;
}
protected void btnacos_Click(object sender, EventArgs e)
{
string deger = txtsonuc.Text;
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
double a, b;
a = Convert.ToDouble(txtsonuc.Text);
b = Convert.ToDouble(Math.Acos(a * Math.PI / 180));
if (b > -Math.PI && b < Math.PI)
{
lstgoster.Items.Add("A_cos(" + deger + ")=" + txtsonuc.Text);
}
else
LblHata.Text = "Tanımlı aralıkta değil";
txtsonuc.Text = "";
return;
}
protected void acot_Click(object sender, EventArgs e)
{
string deger = txtsonuc.Text;
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
double asin, acon, acot, a, b;
if (txtsonuc.Text == "0")
{
LblHata.Text = "işlem yapılamaz";
return;
}
a = Convert.ToDouble(txtsonuc.Text);
asin = Convert.ToDouble(Math.Acos(a * Math.PI / 180));
b = Convert.ToDouble(txtsonuc.Text);
acon = Convert.ToDouble(Math.Asin(a * Math.PI / 180));
acot = acon / asin;
if (acot > -Math.PI && acot < Math.PI)
{
lstgoster.Items.Add("A_cot(" + deger + ")=" + txtsonuc.Text);
}
else
LblHata.Text = "Tanımlı aralıkta değil";
txtsonuc.Text = "";
return;
}
protected void btnmod_Click(object sender, EventArgs e)
{
}
protected void btnkare_Click(object sender, EventArgs e)
{
string deger = txtsonuc.Text;
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
double a, b;
a = Convert.ToDouble(txtsonuc.Text);
b = Convert.ToDouble(Math.Pow(a,2));
lstgoster.Items.Add("(" + deger + " Karesi)=" + b.ToString());
protected void btnkup_Click(object sender, EventArgs e)
{
string deger = txtsonuc.Text;
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
double a, b;
a = Convert.ToDouble(txtsonuc.Text);
b = Convert.ToDouble(Math.Pow(a, 3));
lstgoster.Items.Add("(" + deger + " Küpü)=" + b.ToString());
}
protected void btnus_Click(object sender, EventArgs e)
{
string deger = txtsonuc.Text;
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
double a, b;
hfsayi3.Value = txtsonuc.Text;
a =Convert.ToDouble( hfsayi3.Value);
lstgoster.Items.Add(txtsonuc.Text + " ^ " );
txtsonuc.Text = "";
btnus.CommandArgument = "1";
}
protected void Button3_Click(object sender, EventArgs e)
{
}
protected void Button4_Click(object sender, EventArgs e)
{
}
protected void btnxbol_Click(object sender, EventArgs e)
{
string deger = txtsonuc.Text;
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
double a, b;
a = Convert.ToDouble(txtsonuc.Text);
b = Convert.ToDouble(Math.Sqrt(a));
lstgoster.Items.Add("(" + deger + " 1/2)=" + b.ToString());
}
protected void btnlog_Click(object sender, EventArgs e)
{
string deger = txtsonuc.Text;
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
double a, b;
a = Convert.ToDouble(txtsonuc.Text);
b = Convert.ToDouble(Math.Log10(a));
lstgoster.Items.Add("(" + deger + " Log)=" + b.ToString());
}
protected void btnln_Click(object sender, EventArgs e)
{
string deger = txtsonuc.Text;
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
double a, b;
a = Convert.ToDouble(txtsonuc.Text);
b = Convert.ToDouble(Math.Log(a));
lstgoster.Items.Add("(" + deger + " Ln)=" + b.ToString());
}
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class hesapla : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.CacheControl = "no-cache";
// Response.Cache.SetCacheability(HttpCacheability.NoCache);
LblHata.Text = "";
if (!IsPostBack)
{
hfsayi2.Value = "0";
}
}
public void us(double x , double y)
{
double ust;
ust= Math.Pow(x,y);
txtsonuc.Text = ust.ToString();
}
public void topla(double x, double y)
{
double toplam;
toplam=x+y;
txtsonuc.Text=toplam.ToString();
}
public void cikart(double x, double y)
{
double cikar;
cikar = x - y;
txtsonuc.Text = cikar.ToString();
}
public void bolme(double x, double y)
{
double bol;
bol = x / y;
txtsonuc.Text = bol.ToString();
}
public void carpma(double x, double y)
{
double carp;
carp = x * y;
txtsonuc.Text = carp.ToString();
}
protected void btnyedi_Click(object sender, EventArgs e)
{
btnyedi.Text = "7";
txtsonuc.Text += btnyedi.Text;
}
protected void btnsekiz_Click(object sender, EventArgs e)
{
btnsekiz.Text = "8";
txtsonuc.Text += btnsekiz.Text;
protected void btndokuz_Click(object sender, EventArgs e)
{
btndokuz.Text = "9";
txtsonuc.Text += btndokuz.Text;
}
protected void btndort_Click(object sender, EventArgs e)
{
btndort.Text = "4";
txtsonuc.Text += btndort.Text;
}
protected void btnbes_Click(object sender, EventArgs e)
{
btnbes.Text = "5";
txtsonuc.Text += btnbes.Text;
}
protected void btnalti_Click(object sender, EventArgs e)
{
btnalti.Text = "6";
txtsonuc.Text += btnalti.Text;
}
protected void btnbir_Click(object sender, EventArgs e)
{
btnbir.Text = "1";
txtsonuc.Text += btnbir.Text;
}
protected void btniki_Click(object sender, EventArgs e)
{
btniki.Text = "2";
txtsonuc.Text += btniki.Text;
}
protected void btnuc_Click(object sender, EventArgs e)
{
btnuc.Text = "3";
txtsonuc.Text += btnuc.Text;
}
protected void btntopla_Click(object sender, EventArgs e)
{
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
lstgoster.Items.Add(txtsonuc.Text + " + ");
//double sayi1, sayi2, sayi3;
hfsayi1.Value = txtsonuc.Text;
txtsonuc.Text = "";
btncarp.CommandArgument = "0";
btncikar.CommandArgument = "0";
btnbol.CommandArgument = "0";
btntopla.CommandArgument = "1";
}
protected void btncikar_Click(object sender, EventArgs e)
{
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
lstgoster.Items.Add(txtsonuc.Text + " - ");
//double sayi1, sayi2, sayi3;
hfsayi1.Value = txtsonuc.Text;
txtsonuc.Text = "";
btncarp.CommandArgument = "0";
btncikar.CommandArgument = "1";
btnbol.CommandArgument = "0";
btncarp.CommandArgument = "0";
}
protected void btnbol_Click(object sender, EventArgs e)
{
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
lstgoster.Items.Add(txtsonuc.Text + " / ");
//double sayi1, sayi2, sayi3;
hfsayi1.Value = txtsonuc.Text;
txtsonuc.Text = "";
btncarp.CommandArgument = "0";
btncikar.CommandArgument = "0";
btnbol.CommandArgument = "1";
btntopla.CommandArgument = "0";
}
protected void btncarp_Click(object sender, EventArgs e)
{
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
lstgoster.Items.Add(txtsonuc.Text + " * ");
//double sayi1, sayi2, sayi3;
hfsayi1.Value = txtsonuc.Text;
txtsonuc.Text = "";
btncarp.CommandArgument = "1";
btncikar.CommandArgument = "0";
btnbol.CommandArgument = "0";
btntopla.CommandArgument = "0";
}
protected void btneksiarti_Click(object sender, EventArgs e)
{
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
if (txtsonuc.Text.Substring(0, 1) != "-")
txtsonuc.Text = "-" + txtsonuc.Text;
else
txtsonuc.Text = txtsonuc.Text.Substring(1);
}
protected void Btnesit_Click(object sender, EventArgs e)
{
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
if (btnbol.CommandArgument == "1" && txtsonuc.Text == "0")
{
LblHata.Text = " Sayı / 0 Tanımsızdır işlem yapılamaz";
return;
}
string deger=lstgoster.Items[lstgoster.Items.Count-1].Text;
deger+=txtsonuc.Text;
if(btncarp.CommandArgument=="1")
carpma(double.Parse(hfsayi1.Value), double.Parse(txtsonuc.Text));
if (btncikar.CommandArgument == "1")
cikart(double.Parse(hfsayi1.Value), double.Parse(txtsonuc.Text));
if (btntopla.CommandArgument == "1")
topla(double.Parse(hfsayi1.Value), double.Parse(txtsonuc.Text));
if (btnbol.CommandArgument == "1")
bolme(double.Parse(hfsayi1.Value), double.Parse(txtsonuc.Text));
if (btnus.CommandArgument == "1")
us(double.Parse(hfsayi3.Value), double.Parse(txtsonuc.Text));
lstgoster.Items[lstgoster.Items.Count - 1].Text = deger + "=" + txtsonuc.Text;
//lstgoster.Items.Add("=" + txtsonuc.Text);
return;
}
protected void btntemizle_Click(object sender, EventArgs e)
{
txtsonuc.Text = "";
}
protected void btnnokta_Click(object sender, EventArgs e)
{
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
txtsonuc.Text += ".";
}
protected void Button1_Click(object sender, EventArgs e)
{
Button1.Text = "0";
txtsonuc.Text += Button1.Text;
}
protected void btnmc_Click(object sender, EventArgs e)
{
if (txtsonuc.Text.Length==0)
{
LblHata.Text = "Değer Girilmeden işlem yapılmaz";
return;
}
txthafiza.Text = "";
hfsayi2.Value = "0";
}
protected void btnmarti_Click(object sender, EventArgs e)
{
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
double sayi1;
if (txtsonuc.Text != "")
{
sayi1 = Convert.ToDouble(hfsayi2.Value) + Convert.ToDouble(txtsonuc.Text);
hfsayi2.Value = sayi1.ToString();
txthafiza.Text = "M="+hfsayi2.Value;
txtsonuc.Text = "";
}
}
protected void btnmr_Click(object sender, EventArgs e)
{
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
txtsonuc.Text = hfsayi2.Value;
}
protected void btnmeksi_Click(object sender, EventArgs e)
{
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
double sayi1;
//hfsayi2.Value = txtsonuc.Text;
sayi1 = Convert.ToDouble(hfsayi2.Value) - Convert.ToDouble(txtsonuc.Text);
hfsayi2.Value = sayi1.ToString();
txthafiza.Text = "M=" + hfsayi2.Value;
txtsonuc.Text = "";
}
protected void Button2_Click(object sender, EventArgs e)
{
lstgoster.Items.Clear();
hfsayi1.Value = "";
hfsayi2.Value = "";
txtsonuc.Text = "";
txthafiza.Text = "";
}
protected void btnsin_Click(object sender, EventArgs e)
{
string deger = txtsonuc.Text;
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
double a,b;
a =Convert.ToDouble(txtsonuc.Text);
b = Convert.ToDouble(Math.Sin(a * Math.PI / 180));
lstgoster.Items.Add("sin(" + deger + ")=" +b.ToString("#,##0.00"));
}
protected void btntan_Click(object sender, EventArgs e)
{
string deger = txtsonuc.Text;
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
double a, b;
a = Convert.ToDouble(txtsonuc.Text);
b = Convert.ToDouble(Math.Tan(a * Math.PI / 180));
txtsonuc.Text = b.ToString("#,##0.00");
lstgoster.Items.Add("tan(" + deger + ")=" + b.ToString("#,##0.00"));
}
protected void btncos_Click(object sender, EventArgs e)
{
string deger = txtsonuc.Text;
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
double a, b;
a = Convert.ToDouble(txtsonuc.Text);
b = Convert.ToDouble(Math.Cos (a * Math.PI / 180));
txtsonuc.Text = b.ToString("#,##0.00");
lstgoster.Items.Add("cos(" + deger + ")=" + b.ToString("#,##0.00"));
}
protected void btncot_Click(object sender, EventArgs e)
{
string deger = txtsonuc.Text;
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
if (txtsonuc.Text == "0")
{
LblHata.Text = "işlem yapılamaz";
return;
}
double sin,con,cot,a,b;
a = Convert.ToDouble(txtsonuc.Text);
sin = Convert.ToDouble(Math.Sin(a * Math.PI / 180));
b = Convert.ToDouble(txtsonuc.Text);
con = Convert.ToDouble(Math.Cos(a * Math.PI / 180));
cot = con / sin;
lstgoster.Items.Add("cot(" + deger + ")=" + cot.ToString("#,##0.00"));
}
protected void btnasin_Click(object sender, EventArgs e)
{
string deger = txtsonuc.Text;
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
double a, b;
a = Convert.ToDouble(txtsonuc.Text);
b = Convert.ToDouble(Math.Asin(a * Math.PI / 180));
if ( b > -Math.PI && b< Math.PI)
{
lstgoster.Items.Add("A_sin(" + deger + ")=" + b.ToString("#,##0.00"));
}
else
LblHata.Text = "Tanımlı aralıkta değil";
txtsonuc.Text = "";
return;
protected void btnatan_Click(object sender, EventArgs e)
{
string deger = txtsonuc.Text;
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
double a, b;
a = Convert.ToDouble(txtsonuc.Text);
b = Convert.ToDouble(Math.Atan(a * Math.PI / 180));
if (b > -Math.PI && b < Math.PI)
{
lstgoster.Items.Add("A_tan(" + deger + ")=" + b.ToString("#,##0.00"));
}
else
LblHata.Text = "Tanımlı aralıkta değil";
txtsonuc.Text = "";
return;
}
protected void btnacos_Click(object sender, EventArgs e)
{
string deger = txtsonuc.Text;
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
double a, b;
a = Convert.ToDouble(txtsonuc.Text);
b = Convert.ToDouble(Math.Acos(a * Math.PI / 180));
if (b > -Math.PI && b < Math.PI)
{
lstgoster.Items.Add("A_cos(" + deger + ")=" + txtsonuc.Text);
}
else
LblHata.Text = "Tanımlı aralıkta değil";
txtsonuc.Text = "";
return;
}
protected void acot_Click(object sender, EventArgs e)
{
string deger = txtsonuc.Text;
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
double asin, acon, acot, a, b;
if (txtsonuc.Text == "0")
{
LblHata.Text = "işlem yapılamaz";
return;
}
a = Convert.ToDouble(txtsonuc.Text);
asin = Convert.ToDouble(Math.Acos(a * Math.PI / 180));
b = Convert.ToDouble(txtsonuc.Text);
acon = Convert.ToDouble(Math.Asin(a * Math.PI / 180));
acot = acon / asin;
if (acot > -Math.PI && acot < Math.PI)
{
lstgoster.Items.Add("A_cot(" + deger + ")=" + txtsonuc.Text);
}
else
LblHata.Text = "Tanımlı aralıkta değil";
txtsonuc.Text = "";
return;
}
protected void btnmod_Click(object sender, EventArgs e)
{
}
protected void btnkare_Click(object sender, EventArgs e)
{
string deger = txtsonuc.Text;
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
double a, b;
a = Convert.ToDouble(txtsonuc.Text);
b = Convert.ToDouble(Math.Pow(a,2));
lstgoster.Items.Add("(" + deger + " Karesi)=" + b.ToString());
protected void btnkup_Click(object sender, EventArgs e)
{
string deger = txtsonuc.Text;
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
double a, b;
a = Convert.ToDouble(txtsonuc.Text);
b = Convert.ToDouble(Math.Pow(a, 3));
lstgoster.Items.Add("(" + deger + " Küpü)=" + b.ToString());
}
protected void btnus_Click(object sender, EventArgs e)
{
string deger = txtsonuc.Text;
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
double a, b;
hfsayi3.Value = txtsonuc.Text;
a =Convert.ToDouble( hfsayi3.Value);
lstgoster.Items.Add(txtsonuc.Text + " ^ " );
txtsonuc.Text = "";
btnus.CommandArgument = "1";
}
protected void Button3_Click(object sender, EventArgs e)
{
}
protected void Button4_Click(object sender, EventArgs e)
{
}
protected void btnxbol_Click(object sender, EventArgs e)
{
string deger = txtsonuc.Text;
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
double a, b;
a = Convert.ToDouble(txtsonuc.Text);
b = Convert.ToDouble(Math.Sqrt(a));
lstgoster.Items.Add("(" + deger + " 1/2)=" + b.ToString());
}
protected void btnlog_Click(object sender, EventArgs e)
{
string deger = txtsonuc.Text;
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
double a, b;
a = Convert.ToDouble(txtsonuc.Text);
b = Convert.ToDouble(Math.Log10(a));
lstgoster.Items.Add("(" + deger + " Log)=" + b.ToString());
}
protected void btnln_Click(object sender, EventArgs e)
{
string deger = txtsonuc.Text;
if (txtsonuc.Text.Length == 0)
{
LblHata.Text = "Değer girilmeden işlem yapılamaz";
return;
}
double a, b;
a = Convert.ToDouble(txtsonuc.Text);
b = Convert.ToDouble(Math.Log(a));
lstgoster.Items.Add("(" + deger + " Ln)=" + b.ToString());
}