VİZE 2 SORU 2016



int no = 0, io = 0;
int ne = 0, nk = 0, ie = 0, ik = 0;
private void button2_Click(object sender, EventArgs e) // ERKEK VE KIZ SAYISINI BULUYOR
{
listBox2.Items.Clear();
for (int i = 0; i < listBox1.Items.Count; i++)
{
char[] pa = listBox1.Items[i].ToString().ToCharArray();
if (pa[2] == '1')
{
if (pa[10] == 'E')
{
ne++;
}
if (pa[10] == 'K')
{
nk++;
}
}
if (pa[2] == '2')
{
if (pa[10] == 'E')
{
ie++;
}
if (pa[10] == 'K')
{
ik++;
}
}
}
listBox2.Items.Add("NORMAL ÖĞRETİM ERKEK SAYISI== " + ne);
listBox2.Items.Add("NORMAL ÖĞRETİM KIZ SAYISI== " + nk);
listBox2.Items.Add(" ");
listBox2.Items.Add("İKİNCİ ÖGRETİM ERKEK SAYISI== " + ie);
listBox2.Items.Add("İKİNCİ ÖGRETİM KIZ SAYISI== " + ik);
}
private void button1_Click(object sender, EventArgs e) // NO VE İO SAYISI BULMA
{
listBox2.Items.Clear();
for (int i = 0; i < listBox1.Items.Count; i++)
{
char[] pa = listBox1.Items[i].ToString().ToCharArray();
if (pa[2]=='1')
{
no++;
}
if (pa[2] == '2')
{
io++;
}
}
listBox2.Items.Add("NORMAL ÖĞRETİM SAYISI== " + no);
listBox2.Items.Add("İKİNCİ ÖGRETİM SAYISI== " + io);
}