DERS ÖRNEK
Console.WriteLine(" İ lk Notunuzu Giriniz: ");
int not1 = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("İ ki n ci Notunuzu Giriniz : ");
int not2 = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Ucuncu notunuzu giriniz");
int not3 = Convert.ToInt32(Console.ReadLine());
int sonuc = Convert.ToInt32((not1 + not2 + not3) /3);
Console.WriteLine(" Or t al am a nı z :" + sonuc);
if (sonuc >= 45)
{
Console.WriteLine("Tebrikler Sı n ıf ı Geçtiniz");
}
else Console.WriteLine("S ın ı f T ek r ar ı");
Console.ReadKey();
3.
IF MEVSIM ÖRNEĞI
Console.WriteLine("Bir Mevsim Seciniz");
Console.WriteLine("1. İ l k b a h a r");
Console.WriteLine("2. Yaz");
Console.WriteLine("3. Sonbahar");
Console.WriteLine("4. K ı s");
string mevsim = Console.ReadLine();
if (mevsim == "1")
Console.WriteLine("m a r t , n i s a n , m a y ı s");
else if (mevsim == "2")
Console.WriteLine("haziran, temmuz, agustos");
else if (mevsim == "3")
Console.WriteLine("eylül, ekim, k a s ı m");
else if (mevsim == "4")
Console.WriteLine("a r a l ı k, ocak, subat");
else
Console.WriteLine("Lütfen verilen d e ğ e r l e r d e n
giriniz");
Console.ReadKey();
4.
SWITCH - CASE
Console.WriteLine("Bir Mevsim Seciniz");
Console.WriteLine("1. İ l k b a h a r");
Console.WriteLine("2. Yaz");
Console.WriteLine("3. Sonbahar");
Console.WriteLine("4. K ı s");
string mevsim = Console.ReadLine();
switch (mevsim)
{
case "1": Console.WriteLine("İ l k b a h a r A y l a r ı"); break;
case "2": Console.WriteLine("Yaz A y l a r ı"); break;
case "3": Console.WriteLine("sonbahar A y l a r ı"); break;
case "4": Console.WriteLine("K ı ş A y l a r ı"); break;
default: Console.WriteLine("1-4 a r a s ı Lütfen"); break;
}
Console.ReadKey();
5.
NOT BÜYÜK KÜÇÜK
Console.WriteLine(" İ l k Notunuzu Giriniz: ");
int not1 = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("İ k i n c i Notunuzu Giriniz : ");
int not2 = Convert.ToInt32(Console.ReadLine());
if (not2 > 100 || not2 < 0 || not1 > 100 || not1 < 0)
{ Console.WriteLine("0-100 a r a s ı d e ğ e r giriniz"); }
else
{
if (not1 > not2)
Console.WriteLine("1. notunuz yüksek");
else if (not1 < not2)
Console.WriteLine("2. notunuz yüksek");
else if (not1 == not2)
Console.WriteLine("n o t l a r ı n ı z e ş i t");
}
Console.ReadKey();
6.
NOT DURUMU
Console.WriteLine(" İ l k Notunuzu Giriniz: ");
Double not1 = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("İ k i n c i Notunuzu Giriniz : ");
Double not2 = Convert.ToInt32(Console.ReadLine());
Double sonuc = (not1 + not2) / 2;
Console.WriteLine("n O r t a l a m a n ı z :" + sonuc);
if (sonuc >= 45)
{
Console.WriteLine( "n Tebrikler " + sonuc + "
ortalamayla s ı n ı f ı Geçtiniz");
}
else Console.WriteLine("n S ı n ı f T e k r a r ı");
if (sonuc < 50)
Console.WriteLine("n notunuz z a y ı f");
else if (sonuc < 50 && sonuc < 70 )
Console.WriteLine("n notunuz orta");
else if (sonuc < 70 && sonuc < 85)
Console.WriteLine("n notunuz iyi");
else if (sonuc < 85 && sonuc < 100)
Console.WriteLine("n notunuz pekiyi");
Console.ReadKey();
7.
KDV HESAPLAMA
Console.WriteLine("Lütfen Ürün F i y a t ı Giriniz");
Double fiyat = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("Lütfen Ürün Grubu Seçiniz");
Console.WriteLine("1-G ı d a Ürünleri");
Console.WriteLine("2-S a ğ l ı k Ürünleri");
Console.WriteLine("3-D i ğ e r Ürünler");
String secim = Console.ReadLine();
if (secim == "1")
Console.WriteLine("KDV Dahil Fiyat: {0}" ,
fiyat+(fiyat*0.01));
if (secim == "2")
Console.WriteLine("KDV Dahil Fiyat: {0}", fiyat +
(fiyat * 0.08));
if (secim == "3")
Console.WriteLine("KDV Dahil Fiyat: {0}", fiyat +
(fiyat * 0.18));
Console.ReadKey();
8.
KDV DETAYLI
Console.WriteLine ("Lütfen Ürün F i y a t ı Giriniz ");
Double fiyat = Convert.ToDouble (Console .ReadLine());
Console .WriteLine ("Lütfen Ürün Grubu Seçiniz");
Console .WriteLine ("1-G ı d a Ürünleri");
Console .WriteLine ("2-S a ğ l ı k Ürünleri");
Console .WriteLine ("3-D i ğ e r Ürünler");
String secim = Console.ReadLine ();
if (secim == "1")
{
Console .WriteLine ("KDV Haric Fiyat: {0}", fiyat);
Console .WriteLine ("Eklenen KDV Bedeli : {0}", fiyat * 0.01);
Console .WriteLine ("KDV Dahil Fiyat: {0}", fiyat + (fiyat * 0.01));
}
if (secim == "2")
{
Console .WriteLine ("KDV Haric Fiyat: {0}", fiyat);
Console .WriteLine ("Eklenen KDV Bedeli : {0}", fiyat * 0.08);
Console .WriteLine ("KDV Dahil Fiyat: {0}", fiyat + (fiyat * 0.08));
}
if (secim == "3")
{
Console .WriteLine ("KDV Haric Fiyat: {0}", fiyat);
Console .WriteLine ("Eklenen KDV Bedeli : {0}", fiyat * 0.18);
Console .WriteLine ("KDV Dahil Fiyat: {0}", fiyat + (fiyat * 0.18));
}
Console .ReadKey ();