29 Eylül 2016 Perşembe

9 Ağustos 2016 Salı

3 Haziran 2016 Cuma

C# Sözlük Yapımı Access Veri Tabanlı





Form1 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;
using System.Data.OleDb;

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

        OleDbConnection baglanti = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Sozluk.accdb;");

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            if (radioButton1.Checked && textBox1.Text != "")
            {
                Tr_Ing_Ara(textBox1.Text);
            }
            else if (radioButton2.Checked && textBox1.Text != "")
            {
                Ing_Tr_Ara(textBox1.Text);
            }
        }

        private void Tr_Ing_Ara(string kelime)
        {
            listBox1.Items.Clear();

            try
            {
                if (baglanti.State != ConnectionState.Open)
                    baglanti.Open();

                OleDbCommand komut = new OleDbCommand("Select * From Kelimeler Where Turkce Like '%"+kelime+"%'", baglanti);
                OleDbDataReader oku = komut.ExecuteReader();

                while (oku.Read())
                {
                    listBox1.Items.Add(oku["Ingilizce"].ToString());
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "HATA", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {

                if (baglanti.State != ConnectionState.Closed)
                    baglanti.Close();
            }
        }

        private void Ing_Tr_Ara(string kelime)
        {
            listBox1.Items.Clear();

            try
            {
                if (baglanti.State != ConnectionState.Open)
                    baglanti.Open();

                OleDbCommand komut = new OleDbCommand("Select * From Kelimeler Where Ingilizce Like '%" + kelime + "%'", baglanti);
                OleDbDataReader oku = komut.ExecuteReader();

                while (oku.Read())
                {
                    listBox1.Items.Add(oku["Turkce"].ToString());
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "HATA", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {

                if (baglanti.State != ConnectionState.Closed)
                    baglanti.Close();
            }
        }

        private void radioButton1_CheckedChanged(object sender, EventArgs e)
        {
            label1.Text = "Kelime:";
            this.Text = "Sözlük Türkçe-İngilizce";
        }

        private void radioButton2_CheckedChanged(object sender, EventArgs e)
        {
            label1.Text = "Word:";
            this.Text = "Sözlük İngilizce-Türkçe";
        }

        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            KelimeEkle frm = new KelimeEkle();
            if (frm.ShowDialog() == DialogResult.OK)
            {
                if (frm.Tr == "" || frm.Ing == "")
                {
                    MessageBox.Show("Alanları Boş Geçmeyiniz!!!.", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                try
                {
                    if (baglanti.State != ConnectionState.Open)
                        baglanti.Open();

                    OleDbCommand komut = new OleDbCommand("Insert Into Kelimeler (Turkce,Ingilizce) Values('" + frm.Tr + "','" + frm.Ing + "')", baglanti);
                    komut.ExecuteNonQuery();
                    MessageBox.Show("Kelimeler Eklendi.", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "HATA", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                finally
                {

                    if (baglanti.State != ConnectionState.Closed)
                        baglanti.Close();

                }

            }
        }

        private void toolStripButton2_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Made By Fikri KOCAOĞLAN","Hazırlayan",MessageBoxButtons.OK,MessageBoxIcon.Information);
        }

        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            System.Diagnostics.Process.Start("http://csharp-uygulamalari.blogspot.com.tr/");
        }
    }
}

Form2 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 Tr_Ing_Sozluk
{
    public partial class KelimeEkle : Form
    {
        public KelimeEkle()
        {
            InitializeComponent();
        }

        public string Tr
        {
            get { return textBox1.Text; }
            set { textBox1.Text = value; }
        }

        public string Ing
        {
            get { return textBox2.Text; }
            set { textBox2.Text = value; }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.OK;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.Cancel;
        }
    }

}



Veri Tabanı Görüntüsü:

Paylaş:

2 Haziran 2016 Perşembe

10 Nisan 2016 Pazar

C# Ay Gün ve Yıl Hesaplayan Program




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 Tarih_Hesabi
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text != "" || textBox2.Text != "" || textBox3.Text != "")
            {
                int d_Gun, d_Ay, d_Yil;
                d_Gun = Convert.ToInt32(textBox1.Text);
                d_Ay = Convert.ToInt32(textBox2.Text);
                d_Yil = Convert.ToInt32(textBox3.Text);


                int s_Gun, s_Ay, s_Yil;
                s_Gun = Convert.ToInt32(DateTime.Now.Day);
                s_Ay = Convert.ToInt32(DateTime.Now.Month);
                s_Yil = Convert.ToInt32(DateTime.Now.Year);

                int gun, ay, yil, toplam_Ay, toplam_Gun, toplam_Saat;

                if ((d_Gun >= 1 && d_Gun <= 31) && (d_Ay >= 1 && d_Ay <= 12) && (d_Yil <= s_Yil))
                {
                    if (d_Gun <= s_Gun)
                    {
                        gun = s_Gun - d_Gun;
                    }
                    else
                    {
                        gun = (s_Gun + 30) - d_Gun;
                        s_Ay--;
                    }
                    if (d_Ay <= s_Ay)
                    {
                        ay = s_Ay - d_Ay;
                    }
                    else
                    {
                        ay = (s_Ay + 12) - d_Ay;
                        s_Yil--;
                    }

                    yil = s_Yil - d_Yil;

                    toplam_Ay = (yil * 12) + ay;

                    toplam_Gun = (toplam_Ay * 30) + gun;

                    toplam_Saat = toplam_Gun * 24;

                    MessageBox.Show("Sen Doğalı " + yil + " Yıl " + ay + " Ay " + gun + " Gün Oldu...\nSen Doğalı Toplam " + toplam_Ay + " Ay Oldu...\nSen Doğalı Toplam " + toplam_Gun + " Gün Oldu...\nSen Doğalı Toplam " + toplam_Saat + " Saat Oldu...", "Sonuç", MessageBoxButtons.OK, MessageBoxIcon.Information);

                    textBox1.Clear();
                    textBox2.Clear();
                    textBox3.Clear();
                    textBox1.Focus();
                }
                else
                {
                    MessageBox.Show("Hatalı Giriş Yaptınız Lütfen Kontrol Ediniz!!!", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                textBox1.Focus();
            }
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            if (textBox1.Text.Length == 2) textBox2.Focus();
        }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {
            if (textBox2.Text.Length == 2) textBox3.Focus();
        }

        private void textBox3_TextChanged(object sender, EventArgs e)
        {
            if (textBox3.Text.Length == 4) button1.Focus();
        }

        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            System.Diagnostics.Process.Start("http://csharp-uygulamalari.blogspot.com/");
        }

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

        private void Form1_Load(object sender, EventArgs e)
        {
            label6.Text = " Hazırlayan  Fikri  KOCAOĞLAN  ";
        }
    }
}

Paylaş:

23 Mart 2016 Çarşamba

Java Ay Gün Yıl Hesaplama

package fikri;
import java.util.Date;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.StringTokenizer;
import javax.swing.JOptionPane;

public class TariHesabi {
   
    public static void main(String [] args){
        try
        {
        Date now = new Date();

        DateFormat df = new SimpleDateFormat("dd/MM/yyyy");
        int[] parcaTarih = new int[3];
        int[] parcaTarihNow = new int[3];
        int i=0,j=0;
        String gelenMetin = JOptionPane.showInputDialog("Doğum Tarihinizi Giriniz: \n(gg.aa.yyyy)");
        StringTokenizer stk = new StringTokenizer(gelenMetin, " -/.");
        while(stk.hasMoreTokens())
        {
         parcaTarih[i] = Integer.parseInt(stk.nextToken());
         i++;
        }
       
        StringTokenizer trh = new StringTokenizer(df.format(now), " -/.");
        while(trh.hasMoreTokens())
        {
         parcaTarihNow[j] = Integer.parseInt(trh.nextToken());
         j++;
        }

        int gun,ay,yil;
         if ( parcaTarih[0] <= parcaTarihNow[0] )
         {

             gun = ( parcaTarihNow[0] - parcaTarih[0] );

         }
         else
         {
            gun = ( (parcaTarihNow[0] + 30) - parcaTarih[0]);
            parcaTarihNow[1] = parcaTarihNow[1] - 1;
         }
       
         if ( parcaTarih[1] <= parcaTarihNow[1] )
         {

             ay = ( parcaTarihNow[1] - parcaTarih[1] );
         }
         else
         {
            ay = ( (parcaTarihNow[1] + 12) - parcaTarih[1]);
            parcaTarihNow[2] = parcaTarihNow[2] - 1;
         }
       
         yil = (parcaTarihNow[2] - parcaTarih[2]);
       
         JOptionPane.showMessageDialog(null,"Sen Doğduğundan Beri " + yil + " Yıl " + ay + " Ay " + gun + " Gün Oldu.");
        }
        catch (NumberFormatException ex)
                {
                JOptionPane.showMessageDialog(null,"Lütfen Doğum Tarihinizi Girin!!!");
                }
    }
       
}

Paylaş:

Java Sezar (Caesar) Şifreleme ve Şifreyi Çözme

                                                  Şifreleme

package fikri;
import javax.swing.JOptionPane;

public class Caesar_Sifreleme {
   
    public static void main(String[] args)
    {
        try
        {

            String metin = JOptionPane.showInputDialog("Şifrelenecek Metni Giriniz:");
            int otele=Integer.parseInt(JOptionPane.showInputDialog("Metin Kaç Karakter Ötelensin:\n(Girdiğiniz Sayıyı Unutmayın)"));
            char [] harfler=metin.toCharArray();
            String sifreli="";
   
                for (int i = 0; i < harfler.length; i++) {
           

                    sifreli += Character.toString((char)((harfler[i]+otele)+harfler.length));
           
                }

            JOptionPane.showMessageDialog(null, sifreli);
            System.out.println(sifreli);
        }
    catch(Exception ex)
                {
                    JOptionPane.showMessageDialog(null, ex.getMessage());
                }
   
    }
   
}

                                               Şifreyi Çözme


package fikri;
import javax.swing.JOptionPane;

public class Caesar_Sifresi_Cozumu {
    
    public static void main(String [] args)
    {
        try
        {
            String metin = JOptionPane.showInputDialog("Şifreli Metni Giriniz:");
            int otele=Integer.parseInt(JOptionPane.showInputDialog("Metni Kaç Karakter Ötelediniz:"));
            char [] harfler=metin.toCharArray();
            String sifresiz="";
    
            for (int i = 0; i < harfler.length; i++) {
            

              sifresiz += Character.toString((char)((harfler[i]-otele)-harfler.length));
            
            }

            JOptionPane.showMessageDialog(null, sifresiz);
            System.out.println(sifresiz);
        }
        catch(Exception ex)
                {
                    JOptionPane.showMessageDialog(null, ex.getMessage());
                }
        
    }
    
}

Paylaş:

17 Mart 2016 Perşembe

C# Metinleri Kategorize Etmek


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 Metin_Katagorize
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }



        public static int Kelime_Ara(string metin, string kelime)
        {
            int konum = metin.IndexOf(kelime);
            int sayac = 0;
            while (konum != -1)
            {
                konum = metin.IndexOf(kelime, konum + 1);
                sayac++;
            }
            return sayac + 1;
        }

        private void button1_Click(object sender, EventArgs e)
        {

            string gelen_Metin = richTextBox1.Text;
            gelen_Metin = gelen_Metin.ToLower();
            string[] spor = { "direktör", "menajer", "köşe vuruşu", "krampon", "kaptan", "averaj", "taraftar", " forma", "ofsayt", " kort", "file ", "olimpiyat", "depar", "santra", "defans", "forvet", "hakem", "asist", "faul", "kırmızı kart", "sarı kart", "hat trick", "handikap", "playoff", "fair play", "uzatma", "turnuva", "oyun", "doping", "gol ", "deplasman", "derbi", "antrenman‎", "kulüp", "lig", "takım", "maç", "spor", "futbol", "basketbol", "voleybol", "hentbol", "tenis", "güreş", "smaç", "set ", "santra", "kale ", "saha ", "stad", "rövanş", "step", "bek " };
            string[] muzik = { "remix", "söyleme", "çalma", "mızıka", "klarnet", "davul", " eko ", " bas ", " albüm", "track", " kaset", " plak", "tuba ", "çello", "nakarat", " vurma", "üfleme", "yaylı", "akustik", "hoparlör", "amfi", "mikrofon", "keman", "akort", "orkestra", "ritim", "senfoni", "ritim", "tempo", "arpej", "nota", "arabesk", "rock", "metal", "rap ", "pop ", "müzik", "ses", "solist", "tenor", "müzisyen", "gitar", "saz ", "bağlama", "org ", "piyano", "piano", "flüt", "caz ", "saksafon", "çalgı", "şarkı", "türkü" };
            string[] siyaset = { "tüzük", "mevzuat", "yasa ", "kararname", "parti", "seçim", "vekil", " millet", "hükümet", "tutanak", "siyas", "politika", "tezkere", "danışman", "başkan", "darbe", "iktidar", "muhalefet", "kabine", "büyükelçi", " kamu", "referandum", "divan", " bütçe", "veto", "kurmay", "kongre", "vergi", "cumhur", "koalisyon", "vali", "seçmen", "komisyon", "devlet", "ülke", "nisap", "eylem", "gensoru", "demokrasi", " laik", "ihtilal", "bürokra", "chp", "mhp", "akp", "halk", "miting", "meclis", "tbmm", "avrupa", "örgüt", "terör", "asya" };
            string[] teknoloji = { "bilgisayar", "tablet", "telefon", "android", "network", "teknoloji", "otomatik", "yazılım", "donanım", "bilişim", "işlemci", "sunucu", " makin", "devre", "uygulama", "web ", "internet", "flash", "bilim", "televizyon", " ağ ", "program", "data ", "veri ", "elektirik", "elektronik", "site", "yapay zeka", "google", "facebook", "twitter", "apple", "microsoft", "modem", "4g", "4.5g", "3g", "disk", "ekran", "bluetooth", "media", "wifi", "robot", "oyun", "algoritma", "sürücü", "bağlantı", "cihaz", "dijital", "aygıt", "sayısal", "analog", "linux" };
            string[] saglik = { "hasta", "doktor", "sedye", "hekim", "akut ", "salgın", "hemşir", "serum", "ambulans", "iğne", "ameliyat", "kızılay", "bakteri", "enfeksiyon", "pansuman", "sargı", "anestezi", "damar", "kan ", "sağlık", "vitamin", "fobi", "ilaç", "boyun", "beyin", "kalp", "ciğer", "tıp ", "doku", "böbrek", "bağırsak", "klinik", "dispanser", "dahili", "kist", "virüs", "bulaşıcı", "organ", "enzim", "kemik", "mide", "film", "röntgen", "üroloji", "nöroloji", "psiko", "neşter", "hücre", "göz", "kulak", "burun", "acil", "kırık" };


            double mzk_Say = 0, spr_Say = 0, syst_Say = 0, tknlj_Say = 0, sglk_Say = 0;

            for (int i = 0; i < spor.Length; i++)
            {
                if (gelen_Metin.Contains(spor[i]) == true)
                {
                    spr_Say++;
                    spr_Say += Kelime_Ara(richTextBox1.Text, spor[i]);
                }
            }

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

                if (gelen_Metin.Contains(muzik[i]) == true)
                {
                    mzk_Say++;
                    mzk_Say += Kelime_Ara(richTextBox1.Text, muzik[i]);
                }
            }

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

                if (gelen_Metin.Contains(siyaset[i]) == true)
                {
                    syst_Say++;
                    syst_Say += Kelime_Ara(richTextBox1.Text, siyaset[i]);
                }
            }

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

                if (gelen_Metin.Contains(teknoloji[i]) == true)
                {
                    tknlj_Say++;
                    tknlj_Say += Kelime_Ara(richTextBox1.Text, teknoloji[i]);
                }
            }

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

                if (gelen_Metin.Contains(saglik[i]) == true)
                {
                    sglk_Say++;
                    sglk_Say += Kelime_Ara(richTextBox1.Text, saglik[i]);
                }
            }

            double spor_Yuzde = 0, muzik_Yuzde = 0, siyaset_Yuzde = 0, teknoloji_Yuzde = 0, saglik_Yuzde = 0;


            if (spr_Say != 0)
            {
                spor_Yuzde = (spr_Say / spor.Length) * 100;
            }

            if (mzk_Say != 0)
            {
                muzik_Yuzde = (mzk_Say / muzik.Length) * 100;
            }

            if (syst_Say != 0)
            {
                siyaset_Yuzde = (syst_Say / siyaset.Length) * 100;
            }

            if (tknlj_Say != 0)
            {
                teknoloji_Yuzde = (tknlj_Say / teknoloji.Length) * 100;
            }

            if (sglk_Say != 0)
            {
                saglik_Yuzde = (sglk_Say / saglik.Length) * 100;
            }

            MessageBox.Show("Müzik: %" + muzik_Yuzde + "\nSpor: %" + spor_Yuzde + "\nSiyaset: %" + siyaset_Yuzde + "\nTeknoloji: %" + teknoloji_Yuzde + "\nSağlık: %" + saglik_Yuzde, "Bilgi");

            if (spor_Yuzde > muzik_Yuzde && spor_Yuzde > siyaset_Yuzde && spor_Yuzde > teknoloji_Yuzde && spor_Yuzde > saglik_Yuzde)
            {
                MessageBox.Show("Bu Metin Çoğunlukla(%" + spor_Yuzde + ") Spor İle İlgilidir.", "Bilgi");
            }

            if (siyaset_Yuzde > spor_Yuzde && siyaset_Yuzde > muzik_Yuzde && siyaset_Yuzde > teknoloji_Yuzde && siyaset_Yuzde > saglik_Yuzde)
            {
                MessageBox.Show("Bu Metin Çoğunlukla(%" + siyaset_Yuzde + ") Siyaset İle İlgilidir.", "Bilgi");
            }

            if (muzik_Yuzde > spor_Yuzde && muzik_Yuzde > siyaset_Yuzde && muzik_Yuzde > teknoloji_Yuzde && muzik_Yuzde > saglik_Yuzde)
            {
                MessageBox.Show("Bu Metin Çoğunlukla(%" + muzik_Yuzde + ") Müzik İle İlgilidir.", "Bilgi");
            }

            if (teknoloji_Yuzde > spor_Yuzde && teknoloji_Yuzde > siyaset_Yuzde && teknoloji_Yuzde > muzik_Yuzde && teknoloji_Yuzde > saglik_Yuzde)
            {
                MessageBox.Show("Bu Metin Çoğunlukla(%" + teknoloji_Yuzde + ") Teknoloji İle İlgilidir.", "Bilgi");
            }

            if (saglik_Yuzde > spor_Yuzde && saglik_Yuzde > siyaset_Yuzde && saglik_Yuzde > muzik_Yuzde && saglik_Yuzde > teknoloji_Yuzde)
            {
                MessageBox.Show("Bu Metin Çoğunlukla(%" + saglik_Yuzde + ") Sağlık İle İlgilidir.", "Bilgi");
            }

        }
    }
}



Paylaş:

9 Mart 2016 Çarşamba

5 Mart 2016 Cumartesi

C# Çokgenlerin Alan-Çevresini Hesaplama



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 Cokgen_Hesaplama
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }



        private void button1_Click(object sender, EventArgs e)
        {
            double a, b, snc;
            double.TryParse(textBox1.Text,out a);
            double.TryParse(textBox1.Text, out b);
            snc = a * b;
            label6.Text = button1.Text + "= " + snc;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            double a, b, snc;
            double.TryParse(textBox1.Text, out a);
            double.TryParse(textBox1.Text, out b);
            snc = 2*(a+b);
            label6.Text = button2.Text + "= " + snc;
        }

        private void button4_Click(object sender, EventArgs e)
        {
            double a, snc;
            double.TryParse(textBox4.Text, out a);
            snc = a * a;
            label7.Text = button4.Text + "= " + snc;
        }

        private void button3_Click(object sender, EventArgs e)
        {
            double a, snc;
            double.TryParse(textBox4.Text, out a);
            snc = 4 * a;
            label7.Text = button3.Text + "= " + snc;
        }

        private void button6_Click(object sender, EventArgs e)
        {
            double a, b, snc;
            double.TryParse(textBox7.Text, out a);
            double.TryParse(textBox8.Text, out b);
            snc = (a * b)/2;
            label9.Text = button6.Text + "= " + snc;
        }

        private void button5_Click(object sender, EventArgs e)
        {
            double a, b, c, snc;
            double.TryParse(textBox3.Text, out a);
            double.TryParse(textBox5.Text, out b);
            double.TryParse(textBox6.Text, out c);
            snc = a + b + c;
            label9.Text = button5.Text + "= " + snc;
        }

        private void button8_Click(object sender, EventArgs e)
        {
            double r, snc;
            double.TryParse(textBox9.Text, out r);
            snc = Math.PI * r * r;
            label21.Text = button8.Text + "= " + snc;
        }

        private void button7_Click(object sender, EventArgs e)
        {
            double r, snc;
            double.TryParse(textBox9.Text, out r);
            snc = Math.PI * 2 * r;
            label21.Text = button7.Text + "= " + snc;
        }

        private void button10_Click(object sender, EventArgs e)
        {
            double a, h, snc;
            double.TryParse(textBox10.Text, out a);
            double.TryParse(textBox11.Text, out h);
            snc = a * h;
            label28.Text = button10.Text + "= " + snc;
        }

        private void button9_Click(object sender, EventArgs e)
        {
            double a, b, snc;
            double.TryParse(textBox10.Text, out a);
            double.TryParse(textBox11.Text, out b);
            snc = (a+b)*2;
            label28.Text = button9.Text + "= " + snc;
        }

        private void cokgenler(object sender, EventArgs e)
        {
            RadioButton buton = (RadioButton)sender;
            if (buton.Text == "Dikdörtgen")
            {
                groupBox2.Visible = true;
                groupBox3.Visible = false;
                groupBox4.Visible = false;
                groupBox5.Visible = false;
                groupBox6.Visible = false;
            }
            if (buton.Text == "Kare")
            {
                groupBox2.Visible = false;
                groupBox3.Visible = true;
                groupBox4.Visible = false;
                groupBox5.Visible = false;
                groupBox6.Visible = false;
            }
            if (buton.Text == "Üçgen")
            {
                groupBox2.Visible = false;
                groupBox3.Visible = false;
                groupBox4.Visible = true;
                groupBox5.Visible = false;
                groupBox6.Visible = false;
            }
            if (buton.Text == "Çember")
            {
                groupBox2.Visible = false;
                groupBox3.Visible = false;
                groupBox4.Visible = false;
                groupBox5.Visible = true;
                groupBox6.Visible = false;
            }
            if (buton.Text == "Paralelkenar")
            {
                groupBox2.Visible = false;
                groupBox3.Visible = false;
                groupBox4.Visible = false;
                groupBox5.Visible = false;
                groupBox6.Visible = true;
            }
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            label27.Text = "Hazırlayan: Fikri KOCAOĞLAN ";
        }

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

        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            System.Diagnostics.Process.Start("http://csharp-uygulamalari.blogspot.com.tr/");
        }
    }
}

Paylaş:

4 Mart 2016 Cuma

Java' da Sayıları Binary(İkilik) Sisteme Çevirme

package fikri;
import javax.swing.JOptionPane;

public class Binary {
   
    static String ToBinary(int number)
        {
            int mod;
            String result = "";
            while (number > 0)
            {
                mod = number % 2;
                number /= 2;
                result = String.valueOf(mod) + result;
            }
            return result;
        }
   

    public static void main(String [] args){
         
        int sayi=Integer.parseInt(JOptionPane.showInputDialog("Sayı Giriniz: "));

        int binary=Integer.parseInt(ToBinary(sayi));
       
          JOptionPane.showMessageDialog(null,binary);

       
       
        // ---Fikri Kocaoğlan---
    }
}

Paylaş:

Java' da Sayıların Basamaklarını Bulma

package fikri;
import javax.swing.JOptionPane;

public class Basamak_Bulma {
   
    public static void main(String [] args){
         
        int sayi=Integer.parseInt(JOptionPane.showInputDialog("Sayı Giriniz: ")),basamak=1,say=1;

         for (int i = 0; i <= sayi; i++)
            {
                if (sayi > 10)
                {
                    basamak = sayi % 10;
                    say++;
                    sayi = sayi - basamak;
                    sayi = sayi / 10;
                }
             

            }
       
          JOptionPane.showMessageDialog(null,"Sayı "+ say +" Basamaklı Bir Sayıdır...");

       
       
        // ---Fikri Kocaoğlan---
    }
}

Paylaş:

Java' da n Sayısına Kadar ki Tek Sayıların Toplamı

package fikri;
import javax.swing.JOptionPane;

public class TekSayilariTopla {
   
    public static void main(String [] args){
         
        int sayi=Integer.parseInt(JOptionPane.showInputDialog("Sayı Giriniz: ")),toplam=0;

        for (int i = 0; i <= sayi; i++) {
           
            if(i%2==1)
            {
                toplam = toplam + i;
             }
        }
       

          JOptionPane.showMessageDialog(null, sayi+"(Dahil) Sayısına Kadar ki Tek Sayıların Toplamı = " + toplam);

       
       
        // ---Fikri Kocaoğlan---
    }
}

Paylaş:

Java' da Sayının Tek Mi Çift Olduğunu Bulma

package fikri;
import javax.swing.JOptionPane;

public class TekCift {
   
    public static void main(String [] args){
         
        int sayi=Integer.parseInt(JOptionPane.showInputDialog("Sayı Giriniz: "));



         if(sayi%2==0)
         {
            JOptionPane.showMessageDialog(null, sayi+" Çift Sayıdır...");
         }
         else
         {
          JOptionPane.showMessageDialog(null, sayi+" Tek Sayıdır...");
         }
       
       
        // ---Fikri Kocaoğlan---
    }
}

Paylaş:

Java' da Fibonacci Serisi İle Tavşan Sayısı Bulma Kodları

Bir kümesteki tavşanların sayısının her ay önceki iki aydaki tavşanların sayısının toplamına eşit olduğu varsayılıyor. Örneğin 5. aydaki tavşanların sayısı 3. ve 4. aydaki tavşanların sayılarının toplamına eşit oluyor. Buna göre klavyeden girilen n. ayda tavşan sayısının kaç olacağını hesaplayan program kodları

package fikri;
import javax.swing.JOptionPane;

public class Fibonacci {
    
     public static void main(String [] args){
    

         int sayi, say=2, a=2, b=3,c=0;
        sayi=Integer.parseInt(JOptionPane.showInputDialog("1. Ayda 2\n 2. Ayda 3 Tavşan Olduğu Var Sayılıyor.\n Ay Giriniz: "));
         for (int i = 0; i < sayi; i++) {
             
             if (say < sayi)
                {
                    c = a + b;
                    say++;
                    a = b;
                    b = c;
                }
         }

         JOptionPane.showMessageDialog(null,  sayi + ". Ayda Tavşan Sayısı " + c + " Olur");

         
        
        // ---Fikri Kocaoğlan--- 
    }
    

}

Paylaş:

Java' da Asal Sayı Bulma

package fikri;
import javax.swing.JOptionPane;

public class AsalSayi {
   
    public static void main(String [] args){
   
        int sayi,say=0;
        sayi=Integer.parseInt(JOptionPane.showInputDialog("Sayıyı Giriniz: "));
         for (int i = 2; i <= sayi; i++) {
           
             if(sayi%i==0)
             {
             say++;
             }

         }
         if(say==1)
         {
            JOptionPane.showMessageDialog(null, sayi+" Sayısı Asaldır...");
         }
         else
         {
          JOptionPane.showMessageDialog(null, sayi+" Sayısı Asal Değildir...");
         }
       
        // ---Fikri Kocaoğlan---
    }
   
}

Paylaş:

Java' da Faktöriyel Hesaplama

package fikri;
import javax.swing.JOptionPane;

public class Faktoriyel {
   
     public static void main(String [] args){
   
        int sayi,fact=1;
        sayi=Integer.parseInt(JOptionPane.showInputDialog("Sayıyı Giriniz: "));
         for (int i = 1; i <= sayi; i++) {
           
             fact=fact*i;
         }
        JOptionPane.showMessageDialog(null, "Sonuç: "+fact);
       
        // ---Fikri Kocaoğlan---
    }
   
}

Paylaş:

2 Mart 2016 Çarşamba

Java' da Dört İşlem

package fikri;
import javax.swing.JOptionPane;

public class toplama {
 
    public static void main(String [] args){
 
        int s1,s2,toplam;
        s1=Integer.parseInt(JOptionPane.showInputDialog("1. Sayıyı Giriniz: "));
        s2=Integer.parseInt(JOptionPane.showInputDialog("2. Sayıyı Giriniz: "));
        toplam=s1+s2;
        JOptionPane.showMessageDialog(null, "Sonuç: "+toplam);
     
        //Java'da Dört İşlem Bu Şekilde Yapılabilir... ---Fikri Kocaoğlan---
    }
 
}

Paylaş:

Popüler

Son

Kategoriler