ArrayList - Vize Örneği


Formun Tamamı İçin Tıklayınız.



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;
using System.Collections;
namespace WindowsFormsApplication58
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        ArrayList okulno = new ArrayList();
        ArrayList ad = new ArrayList();
        ArrayList v1 = new ArrayList();
        ArrayList v2 = new ArrayList();
        ArrayList fin = new ArrayList();
        ArrayList ort = new ArrayList();      
        int top = 0;
        private void button1_Click(object sender, EventArgs e)
        {
            int m = okulno.IndexOf(textBox1.Text);
            if (m != -1)
            {
                MessageBox.Show("BAŞKA OKUL NO GİR");
                textBox1.Text = null;
                textBox1.Focus();
            }
            else
            {
                okulno.Add(textBox1.Text);
                ad.Add(textBox2.Text);
                int a = int.Parse(textBox3.Text);
                int b = int.Parse(textBox4.Text);
                int c = int.Parse(textBox5.Text);
                int q = (a * 25) / 100;
                int w = (b * 30) / 100;
                int r = (c * 45) / 100;
                int ortt = q + w + r;
                v1.Add(q);
                v2.Add(w);
                fin.Add(r);
                ort.Add(ortt);
                int n = okulno.Count;
                top = top + ortt;
                int o = top / n;
               
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            listBox1.Items.Clear(); int y = 0; int k = 0;
            listBox1.Items.Add("----Geçenler----");
            for (int i = 0; i < ad.Count; i++)
            {
                if (Convert.ToInt32(ort[i]) > 45)
                {
                    int l = Convert.ToInt32(ort[i]);
                    listBox1.Items.Add(++y + ")" + " " + okulno[i] + " " + ad[i] + " " + l);
                }
            }
            listBox1.Items.Add("----Kalanlar----");
            for (int t = 0; t < ad.Count; t++)
            {
                if (Convert.ToInt32(ort[t]) <= 44)
                {
                    int u = Convert.ToInt32(ort[t]);
                    listBox1.Items.Add(++k + ")" + " " + okulno[t] + " " + ad[t] + " " + u);
                }
            }
        }
    }
}

Hiç yorum yok:

Yorum Gönder