Amaliy matematika va informatika” yo`nalishi 19. 07-guruh talabasi Anvarjonova Dilafruz Dilshodjon qiziнинг


Karra jadvalini C# dasturidagi ilovasi



Download 3,67 Mb.
bet9/9
Sana31.12.2021
Hajmi3,67 Mb.
#242025
1   2   3   4   5   6   7   8   9
Bog'liq
Anvarjonova D. dasturlash

2.2. Karra jadvalini C# dasturidagi ilovasi


    Dasturni ishlatish uchun formani ustiga ikki marta bosib quyidagi kod yoziladi:
        voidMainFormLoad(object sender, EventArgs e)
       {
            label2.Text="";
            label3.Text="";
            label4.Text="";
            label5.Text="";
            label6.Text="";
            label7.Text="";
            label8.Text="";
            label9.Text="";
            label10.Text="";
            label11.Text="";
            label12.Text="";
            label13.Text="";
            label14.Text="";
            label15.Text="";
            label16.Text="";
            label17.Text="";
            label18.Text="";
            label19.Text="";
            label20.Text="";
            label21.Text="";
            label22.Text="";
            label23.Text="";
            label24.Text="";
            label25.Text="";
            label26.Text="";
            label27.Text="";
            label28.Text="";
            label29.Text="";
            label30.Text="";
            label31.Text="";
            textBox1.Enabled=false;
            textBox2.Enabled=false;
            textBox3.Enabled=false;
            textBox4.Enabled=false;
            textBox5.Enabled=false;
            textBox6.Enabled=false;
            textBox7.Enabled=false;
            textBox8.Enabled=false;
            textBox9.Enabled=false;
            textBox10.Enabled=false;
        }

Bu kod dastur ishga tushganda label va textboxlarning yozuvlarini o`chirib. ishlashi yoki ishlamasligini belgilab beradi. Kegin esa button1ning ustiga ikki marta bosib quyidagi kod yoziladi.


        voidButton1Click(object sender, EventArgs e)
        {
            textBox1.Enabled=true;
            textBox2.Enabled=true;
            textBox3.Enabled=true;
            textBox4.Enabled=true;
            textBox5.Enabled=true;
            textBox6.Enabled=true;
            textBox7.Enabled=true;
            textBox8.Enabled=true;
            textBox9.Enabled=true;
            textBox10.Enabled=true;
            label3.Text="*";
            label4.Text="1";
            label6.Text="*";
            label7.Text="2";
            label9.Text="*";
            label10.Text="3";
            label12.Text="*";
            label13.Text="4";
            label15.Text="*";
            label16.Text="5";
            label18.Text="*";
            label19.Text="6";
            label21.Text="*";
            label22.Text="7";
            label24.Text="*";  
            label25.Text="8";
            label27.Text="*";
            label28.Text="9";
            label30.Text="*";
            label31.Text="10";
            if(domainUpDown1.Text=="Bir karra")
            {
            label2.Text="1";
            label5.Text="1";
            label8.Text="1";
            label11.Text="1";
            label14.Text="1";
            label17.Text="1";
            label20.Text="1";
            label23.Text="1";
            label26.Text="1";
            label29.Text="1";
            }
            if(domainUpDown1.Text=="Ikki karra")
            {
            label2.Text="2";
            label5.Text="2";
            label8.Text="2";
            label11.Text="2";
            label14.Text="2";
            label17.Text="2";
            label20.Text="2";
            label23.Text="2";
            label26.Text="2";
            label29.Text="2";
            }
            if(domainUpDown1.Text=="Uch karra")
            {
            label2.Text="3";
            label5.Text="3";
            label8.Text="3";
            label11.Text="3";
            label14.Text="3";
            label17.Text="3";
            label20.Text="3";
            label23.Text="3";
            label26.Text="3";
            label29.Text="3";
            }
            if(domainUpDown1.Text=="To'rt karra")
            {
            label2.Text="4";
            label5.Text="4";
            label8.Text="4";
            label11.Text="4";
            label14.Text="4";
            label17.Text="4";
            label20.Text="4";

      label23.Text="4";


            label26.Text="4";
            label29.Text="4";
            }
            if(domainUpDown1.Text=="Besh karra")
            {
            label2.Text="5";
            label5.Text="5";
            label8.Text="5";
            label11.Text="5";
            label14.Text="5";
            label17.Text="5";
            label20.Text="5";
            label23.Text="5";
            label26.Text="5";
            label29.Text="5";
            }
            if(domainUpDown1.Text=="Olti karra")
            {
            label2.Text="6";
            label5.Text="6";    
            label8.Text="6";
            label11.Text="6";
            label14.Text="6";
            label17.Text="6";
            label20.Text="6";
            label23.Text="6";
            label26.Text="6";
            label29.Text="6";
            }
            if(domainUpDown1.Text=="Yetti karra")
            {
            label2.Text="7";
            label5.Text="7";
            label8.Text="7";
            label11.Text="7";
            label14.Text="7";
            label17.Text="7";
            label20.Text="7";
            label23.Text="7";
            label26.Text="7";
            label29.Text="7";
            }
            if(domainUpDown1.Text=="Sakkiz karra")
            {
            label2.Text="8";
            label5.Text="8";
            label8.Text="8";
            label11.Text="8";
            label14.Text="8";
            label17.Text="8";
            label20.Text="8";
            label23.Text="8";
            label26.Text="8";
            label29.Text="8";
            }
            if(domainUpDown1.Text=="To'qqiz karra")
            {
            label2.Text="9";
            label5.Text="9";
            label8.Text="9";
            label11.Text="9";
            label14.Text="9";
            label17.Text="9";
            label20.Text="9";
            label23.Text="9";
            label26.Text="9";
            label29.Text="9";
            }
            if(domainUpDown1.Text=="O'n karra")
            {
            label2.Text="10";
            label5.Text="10";
            label8.Text="10";
            label11.Text="10";
            label14.Text="10";
            label17.Text="10";
            label20.Text="10";
            label23.Text="10";
            label26.Text="10";
            label29.Text="10";
            }
        }

Bu kod domainUpDown kompanentasini qaysi karra tanlanganiga qarab textboxlarni foaliyatini ishlashni yoqib, labellarga kerakli sonlarni yozadi. Natija tugmasini ustiga ikki marta bosib quydagi kod yoziladi.


        voidButton3Click(object sender, EventArgs e)
        {
            inti=0;
            if(domainUpDown1.Text=="Bir karra")
            {
                if(textBox1.Text=="1") i++;
                if(textBox2.Text=="2") i++;
                if(textBox3.Text=="3") i++;
                if(textBox4.Text=="4") i++;
                if(textBox5.Text=="5") i++;
                if(textBox6.Text=="6") i++;
                if(textBox7.Text=="7") i++;
                if(textBox8.Text=="8") i++;
                if(textBox9.Text=="9") i++;
                if(textBox10.Text=="10") i++;
            }
            if(domainUpDown1.Text=="Ikki karra")
            {
                if(textBox1.Text=="2") i++;
                if(textBox2.Text=="4") i++;
                if(textBox3.Text=="6") i++;
                if(textBox4.Text=="8") i++;
                if(textBox5.Text=="10") i++;
                if(textBox6.Text=="12") i++;
                if(textBox7.Text=="14") i++;
                if(textBox8.Text=="16") i++;
                if(textBox9.Text=="18") i++;
                if(textBox10.Text=="20") i++;
            }
            if(domainUpDown1.Text=="Uch karra")
            {
                if(textBox1.Text=="3") i++;
                if(textBox2.Text=="6") i++;
                if(textBox3.Text=="9") i++;
                if(textBox4.Text=="12") i++;
                if(textBox5.Text=="15") i++;
                if(textBox6.Text=="18") i++;
                if(textBox7.Text=="21") i++;
                if(textBox8.Text=="24") i++;
                if(textBox9.Text=="27") i++;
                if(textBox10.Text=="30") i++;
            }
            if(domainUpDown1.Text=="To'rt karra")
            {
                if(textBox1.Text=="4") i++;
                if(textBox2.Text=="8") i++;
                if(textBox3.Text=="12") i++;
                if(textBox4.Text=="16") i++;
                if(textBox5.Text=="20") i++;
                if(textBox6.Text=="24") i++;
                if(textBox7.Text=="28") i++;
                if(textBox8.Text=="32") i++;
                if(textBox9.Text=="36") i++;
                if(textBox10.Text=="40") i++;
            }
            if(domainUpDown1.Text=="Besh karra")
            {
                if(textBox1.Text=="5") i++;
                if(textBox2.Text=="10") i++;
                if(textBox3.Text=="15") i++;
                if(textBox4.Text=="20") i++;
                if(textBox5.Text=="25") i++;
                if(textBox6.Text=="30") i++;
                if(textBox7.Text=="35") i++;
                if(textBox8.Text=="40") i++;
                if(textBox9.Text=="45") i++;
                if(textBox10.Text=="50") i++;
                
            }
            if(domainUpDown1.Text=="Olti karra")
            {
                if(textBox1.Text=="6") i++;
                if(textBox2.Text=="12") i++;
                if(textBox3.Text=="18") i++;
                if(textBox4.Text=="24") i++;
                if(textBox5.Text=="30") i++;
                if(textBox6.Text=="36") i++;
                if(textBox7.Text=="42") i++;
                if(textBox8.Text=="48") i++;
                if(textBox9.Text=="54") i++;
                if(textBox10.Text=="60") i++;
            }
            if(domainUpDown1.Text=="Yetti karra")
            {
                if(textBox1.Text=="7") i++;
                if(textBox2.Text=="14") i++;
                if(textBox3.Text=="21") i++;
                if(textBox4.Text=="28") i++;
                if(textBox5.Text=="35") i++;
                if(textBox6.Text=="42") i++;
                if(textBox7.Text=="49") i++;
                if(textBox8.Text=="56") i++;
                if(textBox9.Text=="63") i++;
                if(textBox10.Text=="70") i++;
            }
            if(domainUpDown1.Text=="Sakkiz karra")
            {
                if(textBox1.Text=="8") i++;
                if(textBox2.Text=="16") i++;
                if(textBox3.Text=="24") i++;
                if(textBox4.Text=="32") i++;
                if(textBox5.Text=="40") i++;
                if(textBox6.Text=="48") i++;
                if(textBox7.Text=="56") i++;
                if(textBox8.Text=="64") i++;
                if(textBox9.Text=="72") i++;
                if(textBox10.Text=="80") i++;
            }
            if(domainUpDown1.Text=="To'qqiz karra")
            {
                if(textBox1.Text=="9") i++;
                if(textBox2.Text=="18") i++;
                if(textBox3.Text=="27") i++;
                if(textBox4.Text=="36") i++;
                if(textBox5.Text=="45") i++;
                if(textBox6.Text=="54") i++;
                if(textBox7.Text=="63") i++;
                if(textBox8.Text=="72") i++;
                if(textBox9.Text=="81") i++;
                if(textBox10.Text=="90") i++;
            }
            if(domainUpDown1.Text=="O'n karra")
            {
                if(textBox1.Text=="10") i++;
                if(textBox2.Text=="20") i++;
                if(textBox3.Text=="30") i++;
                if(textBox4.Text=="40") i++;
                if(textBox5.Text=="50") i++;
                if(textBox6.Text=="60") i++;
                if(textBox7.Text=="70") i++;
                if(textBox8.Text=="80") i++;
                if(textBox9.Text=="90") i++;
                if(textBox10.Text=="100") i++;
          }
            MessageBox.Show(Convert.ToString(i)+" ta to'g'ri yechdingiz \n"+ Convert.ToString(10-i)+" ta noto'g'ri javob berdingiz");
       }

Bu kod textboxlarga yozligan natijalarni tekshirib ekranga nechta tog`ri yozilganini chiqaradi. Chiqish tugmasining ustiga ikki martta bosib quydagi kod yoziladi.


        voidButton5Click(object sender, EventArgs e)
        {
            Close();
        }

Bu kod dasturni yopadi. Dasturchi haqida tugmasini ustiga ikki martta bosib quydagi kod yoziladi.


        voidButton4Click(object sender, EventArgs e)
        {
            MessageBox.Show("Anvarjonova Dilafruz 19.07-guruh");
        }

Bu kod dasturchi kimligini chiqaradi. Tozalash tugmasining ustiga ikki martta bosib quydagi kod yoziladi.


        voidButton2Click(object sender, EventArgs e)
        {
            label2.Text="";        label2.Enabled=false;
            label3.Text="";        label3.Enabled=false;
            label4.Text="";        label4.Enabled=false;
            label5.Text="";        label5.Enabled=false;
            label6.Text="";        label6.Enabled=false;
            label7.Text="";        label7.Enabled=false;
            label8.Text="";        label8.Enabled=false;
            label9.Text="";        label9.Enabled=false;
            label10.Text="";      label10.Enabled=false;
            label11.Text="";      label11.Enabled=false;
            label12.Text="";      label12.Enabled=false;
            label13.Text="";      label13.Enabled=false;
            label14.Text="";      label14.Enabled=false;
            label15.Text="";      label15.Enabled=false;
            label16.Text="";      label16.Enabled=false;
            label17.Text="";      label17.Enabled=false;
            label18.Text="";      label18.Enabled=false;
            label19.Text="";      label19.Enabled=false;
            label20.Text="";      label20.Enabled=false;
            label21.Text="";      label21.Enabled=false;
            label22.Text="";      label22.Enabled=false;
            label23.Text="";      label23.Enabled=false;
            label24.Text="";      label24.Enabled=false;
            label25.Text="";      label25.Enabled=false;
            label26.Text="";      label26.Enabled=false;
            label27.Text="";      label27.Enabled=false;
            label28.Text="";      label28.Enabled=false
            label29.Text="";      label29.Enabled=false;
            label30.Text="";       label30.Enabled=false;
            label31.Text="";       label31.Enabled=false;

            textBox1.Text="";     textBox1.Enabled=false;


            textBox2.Text="";   textBox2.Enabled=false;
            textBox3.Text="";  textBox3.Enabled=false;
            textBox4.Text="";   textBox4.Enabled=false;
            textBox5.Text="";     textBox5.Enabled=false;
            textBox6.Text="";     textBox6.Enabled=false;
            textBox7.Text="";     textBox7.Enabled=false;
            textBox8.Text="";     textBox8.Enabled=false;
            textBox9.Text="";     textBox9.Enabled=false;
            textBox10.Text="";   textBox10.Enabled=false;
          }
        
    }
}

Bu kod dasturni tozalaydi.


6. Dasturning ishlashi


Dasturni ishga tushiramiz.


«Start» tugmasini bosib, dasturni boshlaymiz. Dastur bizga tasodifiy misollarni beradi va quyidagicha ko`rinishga keladi.


Biz javobni kiritib «Tekshirish» tugmasini bosamiz. Javob to`g`ri bo`lsa dastur bizga «Natija» oynasida bir ball beradi, aks holda haqiqiy to`g`ri javobni «To`g`ri javob» oynasida ko`rsatadi.






Biz yaratgan Karra jadvalini o`rganishni nazorat qiluvchi dastur shu tarzda ishlaydi. Dasturdan chiqmoqchi bo`lsak, tugmasini bosib dasturni yakunlaymiz va form oynasi berkiladi.

Bu dastur yordamida sinf o`quvchilarining ko`paytirish amallari bo`yicha bilimlarini tekshirish mumkin.

XULOSA


Hozirgi kunda O`zbekistonda Informatsion Texnologiyalar va Axborot Texnologiyalarini rivojlantirish yo`lida bir talay ishlar amalga oshirilmoqda. O`zbekiston republikasida hukumatni avtomatlashtirish to`g`risida bir qancha ishlar olib borilmoqda. Hukumatimiz ko`plab ishlarni amalga oshirmoqda. Xususan, ko`plab korxonalarni avtomatlashtirish, ularni ishini yengilashtirsh yo`lida ko`plab ishlar amalga oshirilmoqda.

C# Windows muhitida ishlaydigan dastur tuzish uchun qulay bo`lgan vosita bo`lib, kompyuterda dastur yaratish ishlarini avtomatlashtiradi, xatoliklarni kamaytiradi va dastur tuzuvchi mehnatini yengillashtiradi. C# dasturi zamonaviy vizual loyihalash texnologiyasi asosida ob`ektga yo`naltirilgan dasturlash nazariyasini hisobga olgan holda tuziladi.

C# tilining rivoji bo`lgan ob`ektga yo`naltirilgan Object C/C# dasturlash tillarini ishlatiladi. C# sistemasi dasturni loyihalash va yaratish vaqtini kamaytiradi, hamda Windows muhitida ishlovchi dastur ilovalarini tuzish jarayonini osonlashtiradi.

Men ushbu kurs ishi tayyorlash davomida anchagina bilim va ko’nikmalarda ega bo’ldim. С# dasturlash tilidagi komponentalardan foydalanib, ularning xossalari, metodlarii bilan tanishdim. Men ko`proq karra jadvali dasturini yaratishda label, textBox, button, DamainUpDown komponentalaridan foydalandim. C# dasturlash tilida karra jadvalini yaratish deb nomlangan dastur yaratdim. Ushbu kurs ishim menga ko`p izlanishimga va o`z sohamni chuqurroq o`rganishimga yordam berdi. Zamonaviy dasturlash tillariga bo`lgan qiziqishim yanada ortdi.


FOYDALANILGAN ADABIYOTLAR





  1. Андрей Хейлберг. Язик программиромания С#. 2012г.

  2. Sh.A.Nazirov, R.V.Qobulov “Ob’yektga mo’lajallngan dasturlash”.

  3. Jalolov.O.I,Sharipov.SH.M C# dasturlash tilida fayllar bilan ishlash Uslubiy qo’llanma.

  4. Aripov.M.M,Imomov.T,Irmihammedov Z.M va boshqalar. Informatika va axborot texnologiyalari: Toshkent O’zbekiston.

  5. Герберг Шилдт. Полное Руководство С# 4.0

Internet saytlar:

  1. www.google.uz

  2. www.ziyonet.uz

  3. www.referat.uz

  4. www.dastur.uz


Download 3,67 Mb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6   7   8   9




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish