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 WindowsFormsApplication4
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
double a, hesap;
if (checkBox1.Checked == true)
{
a = Convert.ToDouble(textBox1.Text);
hesap = a * a;
listBox1.Items.Add ( hesap.ToString());
}
if (checkBox2.Checked == true)
{
a = Convert.ToDouble(textBox1.Text);
double hesap1 = Math.Sqrt(a);
listBox2.Items.Add(hesap1.ToString());
}
double[] sayilar = new double[listBox1.Items.Count];
double toplam = 0;
for (int i = 0; i < listBox1.Items.Count; i++)
{
sayilar[i] = Convert.ToDouble(listBox1.Items[i].ToString());
toplam += sayilar[i];
}
textBox2.Text = toplam.ToString();
double[] sayilar1 = new double[listBox2.Items.Count];
double toplam1 = 0;
for (int i1 = 0; i1 < listBox2.Items.Count; i1++)
{
sayilar1[i1] = Convert.ToDouble(listBox2.Items[i1].ToString());
toplam1 += sayilar1[i1];
}
textBox3.Text = toplam1.ToString();
double x, y;
x = Convert.ToDouble(textBox2.Text);
y = Convert.ToDouble(textBox3.Text);
if (x > y)
{
label5.Text = " A dizisi B dizisinden büyüktür";
}
if (y > x)
{
label5.Text = " B dizisi A dizisinden büyüktür";
}
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}
Hiç yorum yok:
Yorum Gönder