C# Hesap Makinesi (Double Parse İşlemleri)

C# Hesap Makinesi (Double Parse İşlemleri) // C# ta newProject->ConsoleApplication seçin// Proje ismine Hesap32 yazın// Editördeki Bütün kodları silerek aşağıdaki kadu yapıştırın// Run düğmesine basın// Cikis() fonksiyonunda exit() veya close() yapamadım onu da siz eklersiniz// Bu dökümandaki amaç double değişkeninin kullanımıdır.#region Kütüphane Dosyalarıusing System;using System.Collections.Generic;using System.Text;#endregionnamespace Hesap32{    class Program    {        #region Bekleme Modu        static void Bekle()        {            while (true)            {                // ...Loading            }        }        #endregion        #region Klavye girişleri        static double TusAl()        {            return double.Parse(Console.ReadLine());        }        #endregion        #region HESAP32 Anaekranı        static  void AnaEkran()        {            Console.Clear();            Console.WriteLine("---------------HESAP32---------------");            Console.WriteLine("[1] TOPLAMA");            Console.WriteLine("[2] CIKARMA");            Console.WriteLine("[3] CARPMA");            Console.WriteLine("[4] BOLME");            Console.WriteLine("[5] KAREAL");            Console.WriteLine("[6] CIKIS");            switch (Convert.ToInt32(TusAl()))            {                case 1: Toplama(); break;                case 2: Cikarma(); break;                case 3: Carpma();  break;                case 4: Bolme(); break;                case 5: KareAl(); break;                case 6: Cikis(); break;                default: AnaEkran(); break;             }        }        #endregion        #region HESAP32 İşlemler Bloğu        static void Toplama()        {            try            {                Console.WriteLine("-----TOPLAMA ISLEMI-----");                Console.WriteLine("1.Sayiyi gir= ");                double s1 = double.Parse(Console.ReadLine());                Console.WriteLine("2.Sayiyi gir= ");                double s2 = double.Parse(Console.ReadLine());                double sonuc = s1 + s2;                Console.WriteLine("Sonuc= " + sonuc.ToString());                Console.WriteLine("Ana Ekrana Donmek icin [ENTER]");                Console.ReadLine();                AnaEkran();            }            catch            {                Hata();            }        }        static void Cikarma()        {            try            {                Console.WriteLine("-----CIKARMA ISLEMI-----");                Console.WriteLine("1.Sayiyi gir= ");                double s1 = double.Parse(Console.ReadLine());                Console.WriteLine("2.Sayiyi gir= ");                double s2 = double.Parse(Console.ReadLine());                double sonuc = s1 - s2;                Console.WriteLine("Sonuc= " + sonuc.ToString());                Console.WriteLine("Ana Ekrana Donmek icin [ENTER]");                Console.ReadLine();                AnaEkran();            }            catch            {                Hata();            }        }        static void Carpma()        {            try            {                Console.WriteLine("-----CARPMA ISLEMI-----");                Console.WriteLine("1.Sayiyi gir= ");                double s1 = double.Parse(Console.ReadLine());                Console.WriteLine("2.Sayiyi gir= ");                double s2 = double.Parse(Console.ReadLine());                double sonuc = s1 * s2;                Console.WriteLine("Sonuc= " + sonuc.ToString());                Console.WriteLine("Ana Ekrana Donmek icin [ENTER]");                Console.ReadLine();                AnaEkran();            }            catch            {                Hata();            }        }        static void Bolme()        {            try            {                Console.WriteLine("-----BOLME ISLEMI-----");                Console.WriteLine("1.Sayiyi gir= ");                double s1 = double.Parse(Console.ReadLine());                Console.WriteLine("2.Sayiyi gir= ");                double s2 = double.Parse(Console.ReadLine());                double sonuc = s1 / s2;                Console.WriteLine("Sonuc= " + sonuc.ToString());                Console.WriteLine("Ana Ekrana Donmek icin [ENTER]");                Console.ReadLine();                AnaEkran();            }            catch            {                Hata();            }        }        static void KareAl()        {            try            {                Console.WriteLine("-----KARE AL-----");                Console.WriteLine("Karesi alinacak sayi gir= ");                double s1 = double.Parse(Console.ReadLine());                double sonuc = s1 * s1;                Console.WriteLine("Sonuc= " + sonuc.ToString());                Console.WriteLine("Ana Ekrana Donmek icin [ENTER]");                Console.ReadLine();                AnaEkran();            }            catch            {                Hata();            }        }        static void Cikis()        {        }        #endregion        #region HESAP32 Hata önleme kodu        static void Hata()        {            Console.Clear();            Console.WriteLine("COK BUYUK BIR SAYI YADA HARF GIRDINIZ");            Console.WriteLine("PROGRAMIN DUZGUN CALISMASI ICIN DAHA DIKKATLI OLUN");            Console.WriteLine("ANA EKRANA DONMEK ICIN BIR TUSA BASIN");            Console.ReadLine();            AnaEkran();        }        #endregion        #region HESAP32 Anametod        static void Main(string[] args)        {            //:Kodlar buraya             Console.Title = "HESAP32 --Caner DEMİRCİ-- c# Console Deneme";            AnaEkran();            Bekle();        }        #endregion    }}

Döküman Arama

Başlık :

Kapat