static void Main(string[]
args)
{
string[]
isim = new string[6];
int
[] notu = new int[6];
int
seçim, gnotu;
string
gisim;
menü:
Console.BackgroundColor
= ConsoleColor.Yellow;
Console.ForegroundColor
= ConsoleColor.Blue;
Console.Clear();
Console.CursorLeft
= 30; Console.CursorTop = 2;
Console.Write("DİZİ İŞLEMLERİ ANA MENÜSÜ");
Console.CursorLeft
= 35; Console.CursorTop = 4;
Console.Write("1-BİLGİ GİRİŞİ");
Console.CursorLeft
= 35; Console.CursorTop = 5;
Console.Write("2-ADINA GÖRE SIRALAMA");
Console.CursorLeft
= 35; Console.CursorTop = 6;
Console.Write("3-NOTUNA GÖRE SIRALAMA");
Console.CursorLeft
= 35; Console.CursorTop = 7;
Console.Write("4-DİZİYİ LİSTELEME");
Console.CursorLeft
= 35; Console.CursorTop = 8;
Console.Write("5-ÇIKIŞ");
Console.CursorLeft
= 30; Console.CursorTop = 10;
Console.Write("SEÇİMİNİZ [1-5] = ");
seçim = Convert.ToInt32(Console.ReadLine());
if
(seçim == 5) Environment.Exit(0);
if
(seçim == 1)
{
Console.Clear();
Console.CursorTop
= 5;
for
(int sayaç = 1; sayaç < 6; sayaç++)
{
Console.CursorLeft
= 35;
Console.Write(sayaç
+ ".Kişinin İsmi =");
isim[sayaç] = Console.ReadLine();
Console.CursorLeft
= 35;
Console.Write(isim[sayaç]
+ "'nin Notu =");
notu[sayaç] = Convert.ToInt32(Console.ReadLine());
}
}
if
(seçim==2)
{
for
(int i = 1; i < 6; i++)
for
(int k = 1; k < 6; k++)
if
(string.Compare(isim[i], isim[k]) == -1)
{
gisim = isim[i];
isim[i] = isim[k];
isim[k] = gisim;
gnotu = notu[i];
notu[i] = notu[k];
notu[k] = gnotu;
}
Console.CursorTop
= 15;
Console.CursorLeft
= 30;
Console.WriteLine("Adına Göre Sıralama Tamamlandı");
}
if
(seçim == 3)
{
for
(int i = 1; i < 6; i++)
for
(int k = 1; k < 6; k++)
if (notu[i] < notu[k])
{
gisim = isim[i];
isim[i] = isim[k];
isim[k] = gisim;
gnotu = notu[i];
notu[i] = notu[k];
notu[k] = gnotu;
}
Console.CursorTop
= 15;
Console.CursorLeft
= 30;
Console.WriteLine("Notuna Göre Sıralama Tamamlandı");
}
if
(seçim==4)
{
Console.Clear();
Console.CursorTop
= 5;
Console.CursorLeft
= 30;
Console.WriteLine("İsimler
Notlar");
for
(int sayaç = 1; sayaç < 6; sayaç++)
{
Console.CursorLeft
= 30;
Console.CursorTop
= sayaç + 5;
Console.Write(isim[sayaç]);
Console.CursorLeft
= 45;
Console.WriteLine(notu[sayaç]);
}
}
Console.CursorTop
= 17;
Console.CursorLeft
= 25;
Console.WriteLine("Ana Menüye Dönmek İçin Bir Tuşa Basınız");
Console.ReadKey();
goto
menü;
}
}
Hiç yorum yok:
Yorum Gönder