24 Mart 2015 Salı

C# Klavyeden girilen notların ortalamasını alan program (Siyah Ekran)



Kodları:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
           Console.Write("1.yazılı notu:");
           int x, y, s;
           x = Convert.ToInt32(Console.ReadLine());
           Console.Write("2.yazılı notu:");
           y=Convert.ToInt32(Console.ReadLine());
           Console.Write("Sözlü notunuzu giriniz:");
           s = Convert.ToInt32(Console.ReadLine());
           int ort = (x + y + s) / 3;
           if (ort >= 0 && ort <= 24)
           Console.WriteLine("ders notu 0");
           else if (ort >= 25 && ort <= 44)
           Console.WriteLine("ders notu 1");
           else if (ort >= 45 && ort <= 54)
           Console.WriteLine("ders notu 2");
           else if (ort >= 55 && ort <= 69)
           Console.WriteLine("ders notu 3");
           else if (ort >= 70 && ort <= 84)
           Console.WriteLine("ders notu 4");
           else if (ort >= 85 && ort <= 100)
           Console.WriteLine("ders notu 5");
           else if (ort < 0 && ort > 100)
           Console.WriteLine("Girilen not geçersizdir");
           Console.ReadKey();
        }
    }
}
     

Hazırlayan:Adil AYGÜN

C# Fibonacci serisi (Siyah Ekran)



Kodları:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int a = 0;
            int b = 1;
            int adet;

            Console.Write("Kaç adet fibonacci sayısı görüntülemek istiyorsunuz= ");
            adet = Convert.ToInt32(Console.ReadLine());

            Console.Write(a + " " + b + " ");

            for (int i = 3; i <= adet; i++)
            {
                int c = a + b;
                Console.Write(c + " ");

                a = b;
                b = c;
            }
            Console.ReadLine();

        }
    }
}
 

Hazırlayan:Adil AYGÜN

C# Klavyeden girilen bir kelimenin harflerini alfebetik sıraya göre sıralayan program (Siyah ekran)



Kodları:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.Write("Bir Kelime Giriniz = ");

            string isim = Convert.ToString(Console.ReadLine());

            int uzunluk = isim.Length;

            char[] dizi = new char[uzunluk];

            string sirali = "Alfebetik Sıra İle Dizilişi = ";

            for (int i = 0; i < uzunluk; i++)
            {
                dizi[i] = isim[i];
            }
            Array.Sort(dizi);

            for (int i = 0; i < uzunluk; i++)
            {
                sirali += dizi[i];
            }
            Console.WriteLine(sirali);
            Console.ReadLine();
        }
    }
}

Hazırlayan:Adil AYGÜN

C# Klavyeden girilen iki sayının birbirine tam olarak bölünüp bölünbilmediğini kontrol eden program (Siyah Ekran)




Kodları:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.Write("Lütfen 1. Sayıyı Giriniz = ");
            int a = Convert.ToInt32(Console.ReadLine());
            Console.Write("Lütfen 2. Sayıyı Giriniz = ");
            int b = Convert.ToInt32(Console.ReadLine());
            if (a > b)
            {
                if (a % b == 0)
                {
                    Console.Write(a + " Sayısı " + b + " Sayısına Tam Bölünüyor");
                }
                else
                {
                    Console.Write("Bu Sayılar Birbirine Tam Bölünmez");
                }
            }
            else
            {
                if (b % a == 0)
                {
                    Console.Write(b + " Sayısı " + a + " Sayısına Tam Bölünüyor.");
                }
                else
                {
                    Console.Write("Bu Sayılar Birbirine Tam Bölünmez");
                }
            }
            Console.ReadKey();
        }
    }
}


Hazırlayan:Adil AYGÜN

C# Klavyeden girilen iki değere dört işlem yaptırma (Siyah Ekran)





Kodları:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            double x, y;
            double toplama, cikartma, carpma, bolme;
            Console.Write("Lütfen X Değerini Giriniz = ");
            x = Convert.ToInt32(Console.ReadLine());
            Console.Write("Lütfen Y Değerini Giriniz = ");
            y = Convert.ToInt32(Console.ReadLine());
            toplama = x + y;
            cikartma = x - y;
            bolme = x / y;
            carpma = x * y;
            Console.WriteLine("x+y = " + toplama);
            Console.WriteLine("x-y = " + cikartma);
            Console.WriteLine("x/y = " + bolme);
            Console.WriteLine("x*y = " + carpma);
            Console.Write("Programdan Çıkmak İçin Enter'e Basınız");
            Console.ReadKey();
        }
    }
}


Hazırlayan:Adil AYGÜN

23 Mart 2015 Pazartesi

5 Sayının en büyüğünü bulan program



Örneğin Kodları :


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;

namespace Örnek4
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            double a, b, c, d, f,hesapla,hesap;

            a = Convert.ToDouble(textBox1.Text);
            b = Convert.ToDouble(textBox2.Text);
            c = Convert.ToDouble(textBox3.Text);
            d = Convert.ToDouble(textBox4.Text);
            f = Convert.ToDouble(textBox5.Text);

            hesapla = Math.Max(Math.Max(a,b),Math.Max(c,d));          
            hesap =Math.Max(hesapla,f);

            label6.Text = hesap.ToString();
         
                                                                    // Yapım Erdoğan Gençtürk

        }
    }
}

Siyah ekranda Kare dikdörtgen Alan-çevre Hesaplama




Örneğin Kodları :


using System;

using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication26
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("kare-dikdörtgen");
            Console.WriteLine("şekil-çiziniz");
            string sekil;
            sekil = Console.ReadLine();
            switch(sekil)
            {
                case "kare":
                    Console.WriteLine("karenin kenarını gir");
                    int a;
                    a = Convert.ToInt32(Console.ReadLine());
                    int alan = a * a;
                    int cevre = 4 * a;
                    Console.WriteLine("alan="+alan);
                    Console.WriteLine("cevre="+cevre);
                    break;
                case "dikdörtgen":
                    Console.WriteLine("dikdörtgenin uzun kenarını gir");
                    int b;
                    int kısa=Convert.ToInt32(Console.ReadLine());
                    Console.WriteLine("dikdörtgenin kısa kenarını gir");
                    int uzun=Convert.ToInt32(Console.ReadLine());
                    int dalan = kısa * uzun;
                    int dcevre = 2 * (kısa + uzun);
                    Console.WriteLine("alan="+dalan);
                    Console.WriteLine("cevre="+dcevre);
                    break;
                default:
                    Console.WriteLine("hatalı giriş");
                    break;
            }
            Console.ReadLine();
                                                        Yapım : Erdoğan Gençtürk 

        }
    }
}




C# Matematiksel işlemler



Kodları:



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;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private void button1_Click_1(object sender, EventArgs e)
        {
            listBox1.Items.Add(textBox1.Text);
            textBox1.Text = "";
        }

        private void button2_Click(object sender, EventArgs e)
        {
            int[] sayilar = new int[listBox1.Items.Count];
            for (int i = 0; i < listBox1.Items.Count; i++)
            {
                sayilar[i] = Int16.Parse(listBox1.Items[i].ToString());
            }
        }

        private void button3_Click(object sender, EventArgs e)
        {
            int[] sayilar = new int[listBox1.Items.Count];
            for (int i = 0; i < listBox1.Items.Count; i++)
            {
                sayilar[i] = Int16.Parse(listBox1.Items[i].ToString());
            }
            Array.Sort(sayilar);
            MessageBox.Show("Dizideki En Büyük Sayı = " + sayilar[sayilar.Length - 1]);
        }

        private void button4_Click(object sender, EventArgs e)
        {
            int[] sayilar = new int[listBox1.Items.Count];
            for (int i = 0; i < listBox1.Items.Count; i++)
            {
                sayilar[i] = Int16.Parse(listBox1.Items[i].ToString());
            }
            Array.Sort(sayilar);
            MessageBox.Show("Dizideki En Büyük Sayı = " + sayilar[0]);
        }

        private void button5_Click(object sender, EventArgs e)
        {
            int[] sayilar = new int[listBox1.Items.Count];
            for (int i = 0; i < listBox1.Items.Count; i++)
            {
                sayilar[i] = Int16.Parse(listBox1.Items[i].ToString());
            }
            int toplam = 0;
            foreach (int i in sayilar)
            {
                toplam = toplam + i;
            }
            MessageBox.Show("Dizideki Sayıların Toplamı = " + toplam);
        }

        private void button6_Click(object sender, EventArgs e)
        {
            int[] sayilar = new int[listBox1.Items.Count];
            for (int i = 0; i < listBox1.Items.Count; i++)
            {
                sayilar[i] = Int16.Parse(listBox1.Items[i].ToString());
            }
            int toplam = 0;
            foreach (int i in sayilar)
            {
                toplam = toplam + i;
            }
            MessageBox.Show("Dizideki Sayıların Ortalaması = " + toplam / sayilar.Length);
        }

        private void button7_Click(object sender, EventArgs e)
        {
            int[] sayilar = new int[listBox1.Items.Count];
            for (int i = 0; i < listBox1.Items.Count; i++)
            {
                sayilar[i] = Int16.Parse(listBox1.Items[i].ToString());
            }
            listBox2.Items.Clear();
            foreach (int i in sayilar)
            {
                if (i % 2 != 0) listBox2.Items.Add(i);
            }
        }

        private void button8_Click(object sender, EventArgs e)
        {
            int[] sayilar = new int[listBox1.Items.Count];
            for (int i = 0; i < listBox1.Items.Count; i++)
            {
                sayilar[i] = Int16.Parse(listBox1.Items[i].ToString());
            }
            listBox2.Items.Clear();
            foreach (int i in sayilar)
            {
                if (i % 2 == 0) listBox2.Items.Add(i);
            }
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            timer1.Start();
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            this.Text = this.Text.Substring(1) + this.Text.Substring(0, 1);
        }
    }
}



Hazırlayan:Adil AYGÜN

20 Mart 2015 Cuma

C # Alarm Yapımı




KOD KISMI


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;

namespace ALARM
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            timer1.Start();
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            label1.Text = DateTime.Now.Hour.ToString();
            label2.Text = DateTime.Now.Minute.ToString();
            label5.Text = DateTime.Now.Second.ToString();

            if (comboBox2.Text == label2.Text&&comboBox1.Text==label1.Text)
            {
                timer1.Stop();
                MessageBox.Show("uyarı zamanı");
               


            }
          
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            for (int i = 0; i < 24; i++)
            {
                comboBox1.Items.Add(i);
           
           
           
            }
            for (int j = 0; j < 60; j++)
            {
                comboBox2.Items.Add(j);



            }
          
        }
    }

}


ONUR TAŞKIN

C# Saat Yapımı



KOD KISMI


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;

namespace saat
{
    public partial class Form1 : Form
    {
        int dakika, saniye, salise;
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            dakika = 02;
            saniye = 01;
            salise = 1;
            timer1.Enabled = true;
            timer1.Interval = 10;

        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            salise -= 1;
            label1.Text = (salise / 3600).ToString("00");
            label2.Text = ((salise % 3600) / 60).ToString("00");
            label3.Text = (salise % 60).ToString("00");
            button1.Text = "SIFIRLA";

            if (salise == 00 && dakika == 00 && saniye == 00)
            {
                timer1.Stop();
              
            }

        }

        private void groupBox1_Enter(object sender, EventArgs e)
        {

        }
    }
}

ONUR TAŞKIN


C # Kolay Araba Yarışı



KOD KISMI


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;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {

        Random a = new Random();
        int x1, x2, x3;
        public Form1()
        {
            InitializeComponent();
        }

        private void pictureBox8_Click(object sender, EventArgs e)
        {
            timer1.Start();
            timer2.Start();
            timer3.Start();
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            x1 = x1 + 2;
            pictureBox9.Location = new Point(x1, 60);

            if (x1 == 400)
            {
                timer1.Stop();
                listBox1.Items.Add("porsche");
            }
        }

        private void pictureBox1_Click(object sender, EventArgs e)
        {

        }

        private void Form1_Load(object sender, EventArgs e)
        {
            this.Text = "ARABA YARIŞI";
            int r1 = a.Next(5, 50);
            int r2 = a.Next(5, 50);
            int r3 = a.Next(5, 50);

            timer1.Interval = r1;
            timer2.Interval = r2;
            timer3.Interval = r3;

          
        }

        private void timer2_Tick(object sender, EventArgs e)
        {
            x2 = x2 + 2;
            pictureBox10.Location = new Point(x2, 230);

            if (x2 == 400)
            {
                timer2.Stop();
                listBox1.Items.Add("bmw");
            }
        }

        private void timer3_Tick(object sender, EventArgs e)
        {
            x3 = x3 + 2;
            pictureBox11.Location = new Point(x3, 388);

            if (x3 == 400)
            {
                timer3.Stop();
                listBox1.Items.Add("ferrari");
            }
        }


ONUR TAŞKIN

19 Mart 2015 Perşembe

c# messagebox ile dizi örneği






KOD KISMI:

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;

namespace Message_Box_ile_Dizi_örneği
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        
        private void button1_Click(object sender, EventArgs e)
        {
           


        }

        private void button2_Click(object sender, EventArgs e)
        {
            int i;
            string [] adlar = new string[6];
            adlar[0] = "kemal";
            adlar[1] = "meltem";
            adlar[2] = "Dilara";
            adlar[3] = "Kerem";
            adlar[4] = "ibo";
            adlar[5] = "Onur";

            for (i = 0; i <=5 ; i++)
            {
                MessageBox.Show(adlar[i]);
            
            }
            
        }
    }
}


YAPIM --> FURKAN ÇEBİ















































c# textboxa girdiğimiz karakter ve kelime sayısını bulan program



KOD KISMI:

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;

namespace KELİME_VE_KARAKTER_SAYISI_ÖRNEĞİ
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
     
        private void button2_Click(object sender, EventArgs e)
        {
            //TEMİZLE BUTONU İLE TEXTBOX VE LABELLERİ TEMİZLİYORUZ..

            label3.Text = string.Empty;
            label4.Text = string.Empty;
            textBox1.Text = string.Empty;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            // BURADA KARAKTER SAYISINI TEXTBOXA GİRDİĞİMİZ KARAKTER SAYISININ UZUNLUĞUNA EŞİTLEDİK.
         
            label4.Text = textBox1.TextLength.ToString();
            string a;
            a = Convert.ToString(textBox1.Text);
            int sayac = 0;
            int b;
            b = textBox1.TextLength;
         
         

         
            for (int i = 0; i < b; i++)
            {
             
                // BURADA "İ" BOŞLUĞA EŞİT OLDUĞU ZAMAN KELİME SAYISINI 1 ARTIRMASINI İSTEDİK.
                if (textBox1.Text.Substring(i, 1) == " ")
                {
                    sayac++;
               
                }


            }

            label3.Text = (sayac + 1).ToString();




        }
    }
}

YAPIM --> FURKAN ÇEBİ