0% found this document useful (0 votes)
14 views3 pages

public partial class Form1 _ Form

The document is a C# Windows Forms application that manages personnel data, including names and salaries. It allows users to create a list of personnel, search for specific personnel, clear the list, and find the highest and lowest salaries among the personnel. Additionally, it provides functionality to display personnel with salaries below a certain threshold and count those within a specific salary range.

Uploaded by

aysenurbaloglu6
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views3 pages

public partial class Form1 _ Form

The document is a C# Windows Forms application that manages personnel data, including names and salaries. It allows users to create a list of personnel, search for specific personnel, clear the list, and find the highest and lowest salaries among the personnel. Additionally, it provides functionality to display personnel with salaries below a certain threshold and count those within a specific salary range.

Uploaded by

aysenurbaloglu6
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

public partial class Form1 : Form

{
public Form1()
{
InitializeComponent();
}
int index = 0;
string[] personeller;
int[] maaslar;
private void Form1_Load(object sender, EventArgs e)
{
this.BackColor = Color.Red;
}

private void btnoluştur_Click(object sender, EventArgs e)


{
//DİZİ OLUŞTUR VE LİSTELE
listBox1.Items.Clear();
personeller = new String[] { "Ali", "Veli", "Semra", "Mehmet", "Sude", "Sevda", "Deniz" };
maaslar = new int[] { 39000, 38000, 58000, 55000, 35000, 30000, 25000 };

for (int i = 0; i < personeller.Length; i++)


{
listBox1.Items.Add(personeller[i] + "\t" + maaslar[i]);
}
}

private void btnara_Click(object sender, EventArgs e)


{
string aranan = textBox1.Text;
bool bulundu = false;
for (int i = 0; personeller.Length > 0; i++)
{
if (personeller[i] == aranan)
{
bulundu = true;
listBox1.SelectedIndex = i;
break;
}

if (bulundu)
{
MessageBox.Show("Personel Mevcut");
}
else
{
MessageBox.Show("Personel Mevcut Değil");
}

private void btnTemizle_Click(object sender, EventArgs e)


{
listBox1.Items.Clear();
}

private void btntps_Click(object sender, EventArgs e)


{
label2.Text = "Toplam Personel Sayısı:" + personeller.Length;
}

private void btnedm_Click(object sender, EventArgs e)


{
//EN DÜŞÜK MAAŞ
int dusuk = maaslar[0];

for (int i = 0; i < maaslar.Length; i++)


{
if (dusuk > maaslar[i])
{

dusuk = maaslar[i];
//MAAŞLAR 0 = 39000
//MAAŞLAR 1 = 38000
//MAAŞLAR 2 = 38000
//MAAŞLAR 6 = 25000
}
}
label2.Text = "En Düşük Maaş" + dusuk;
//En yüksek maaşı bulma kodunu yaz
}

private void btnzengin_Click(object sender, EventArgs e)


{
int yuksek = maaslar[0];
int yuksekIndex = 0;

for (int i = 0; i < maaslar.Length; i++)


{
if (yuksek > maaslar[i])
{
yuksek = maaslar[i];
yuksekIndex = i;
}
}
label2.Text = "En yüksek Maaşı Alan Personel:" + personeller[yuksekIndex];
}

private void btnfakir_Click(object sender, EventArgs e)


{
listBox1.Items.Clear();
//MAAŞI 40000 ALTINDA OLANLAR
for (int i = 0; i < maaslar.Length; i++)
{
if (maaslar[i] < 40000)
{
listBox1.Items.Add(personeller[i] + ">>" + maaslar[i]);
}
}
}

private void btnorta_Click(object sender, EventArgs e)


{
//MAAŞI 50 İLE 70 BİN ARASI OLANLAR
listBox1.Items.Clear();
int sayac = 0;
for (int i = 0; i < maaslar.Length; i++)
{
if (maaslar[i] < 70000 && maaslar[i] > 50000)
{
sayac++;
}
}
label2.Text = "MAAŞI 50 İLE 70 ARASI OLANLAR:" + sayac;
}

You might also like