Wpis z mikrobloga

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

namespace koko
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void comboBox1_SelectedInexChanged(object sender, EventArgs e)
{

}

double funkcja(double xx)

{
return xx * xx;
}
private void button1_Click(object sender, EventArgs e)
{
double A, B, H, Pole, Suma, x;
int N;

A = Convert.ToDouble(textBox1.Text);
B = Convert.ToDouble(textBox2.Text);
N = Convert.ToInt16(textBox3.Text);

H = (B - A) / N;

Pole = 0;
Suma = 0;
x = A;

for (int i = 0; i < N; i++)
{
switch (comboBox1.SelectedIndex)
{
case 0: Pole = H * funkcja(x);
break;
case 1: Pole = H * funkcja(x + H / 2);
break;
case 2:
Pole = (funkcja(x) + funkcja(x + H)) * H / 2;
break;
case 3:
Pole = (funkcja(x + H / 3) + funkcja(x + 2 * H / 3)) * H / 2;
break;
}
Suma += Pole;
x += H;
}
textBox4.AppendText("Całka = " + Suma.ToString() + "\r\n");
}
}
}

Witam mam kod ale jak dodac ikony i je podpisac żeby wszystko działało, bo narazie nie wiem jak opisac te textboxy i combo box

#C, #programowanie, #C#
  • 1