Code:
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
int n;
double sum, sv;
private void button1_Click(object sender, EventArgs e)
{
double x;
x = Convert.ToDouble(textBox1.Text);
sum += x;
n += 1;
textBox2.Text = n.ToString();
textBox1.Text = "";
textBox4.Text= textBox4 .Text + x + ",";
}
private void button2_Click(object sender, EventArgs e)
{
sv = (double)sum / n;
textBox3.Text = sv.ToString();
}
private void button3_Click(object sender, EventArgs e)
{
n = 0;
sum = 0;
textBox2.Text = "";
textBox3.Text = "";
textBox4.Text = "";
}
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
int n;
double sum, sv;
private void button1_Click(object sender, EventArgs e)
{
double x;
x = Convert.ToDouble(textBox1.Text);
sum += x;
n += 1;
textBox2.Text = n.ToString();
textBox1.Text = "";
textBox4.Text= textBox4 .Text + x + ",";
}
private void button2_Click(object sender, EventArgs e)
{
sv = (double)sum / n;
textBox3.Text = sv.ToString();
}
private void button3_Click(object sender, EventArgs e)
{
n = 0;
sum = 0;
textBox2.Text = "";
textBox3.Text = "";
textBox4.Text = "";
}
Ovako nesto sam zamislio,ali nece da radi.
Code:
private void btnMin_Click(object sender, EventArgs e)
{
double min = 0;
double y;
y = Convert.ToDouble(textBox4.Text);
for (int i = 0; i <= y ; i++)
{
if (i < min)
{
min = i;
}
}
textBox5.Text = min.ToString();
}
}
}
private void btnMin_Click(object sender, EventArgs e)
{
double min = 0;
double y;
y = Convert.ToDouble(textBox4.Text);
for (int i = 0; i <= y ; i++)
{
if (i < min)
{
min = i;
}
}
textBox5.Text = min.ToString();
}
}
}